diff options
author | Yamagishi Kazutoshi <ykzts@desire.sh> | 2017-06-08 20:24:28 +0900 |
---|---|---|
committer | Eugen Rochko <eugen@zeonfederated.com> | 2017-06-08 13:24:28 +0200 |
commit | 0a0b9a271a8de84272ff2dafc96ef53db224bb21 (patch) | |
tree | 39a325adf00bb3f57d65510029d9b85d1d4b5de1 /app/models/concerns | |
parent | 7d2b4186c37ec81ae896eb57168cb0374de2c656 (diff) |
Improve RuboCop rules (compatibility to Code Climate) (#3636)
https://github.com/codeclimate/codeclimate-rubocop/blob/08f8de84ebfb39caa96391e23816877278f6441c/Gemfile.lock#L38 Code Climate is using RuboCop v0.46.0. Change several rules to maintain compatibility.
Diffstat (limited to 'app/models/concerns')
-rw-r--r-- | app/models/concerns/paginable.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/app/models/concerns/paginable.rb b/app/models/concerns/paginable.rb index 9e95cd649..6061bf9bd 100644 --- a/app/models/concerns/paginable.rb +++ b/app/models/concerns/paginable.rb @@ -6,8 +6,8 @@ module Paginable included do scope :paginate_by_max_id, ->(limit, max_id = nil, since_id = nil) { query = order(arel_table[:id].desc).limit(limit) - query = query.where(arel_table[:id].lt(max_id)) unless max_id.blank? - query = query.where(arel_table[:id].gt(since_id)) unless since_id.blank? + query = query.where(arel_table[:id].lt(max_id)) if max_id.present? + query = query.where(arel_table[:id].gt(since_id)) if since_id.present? query } end |