aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authoryuuji.yaginuma <yuuji.yaginuma@gmail.com>2016-02-11 08:49:55 +0900
committeryuuji.yaginuma <yuuji.yaginuma@gmail.com>2016-02-11 08:51:02 +0900
commit424b2019830ea4c08e86ba9ff9600aa23a54cb4f (patch)
tree1c7ec1a7d2bb65e764a9825407b8c63634e42c1c /activerecord
parent3553fe03ad974bad6a97b1853b1b27c4798f1d06 (diff)
downloadrails-424b2019830ea4c08e86ba9ff9600aa23a54cb4f.tar.gz
rails-424b2019830ea4c08e86ba9ff9600aa23a54cb4f.tar.bz2
rails-424b2019830ea4c08e86ba9ff9600aa23a54cb4f.zip
remove warnings from FinderMethods
This removes the following warnings. ``` activerecord/lib/active_record/relation/finder_methods.rb:252: warning: ambiguous first argument; put parentheses or a space even after `-' operator activerecord/lib/active_record/relation/finder_methods.rb:258: warning: ambiguous first argument; put parentheses or a space even after `-' operator activerecord/lib/active_record/relation/finder_methods.rb:268: warning: ambiguous first argument; put parentheses or a space even after `-' operator activerecord/lib/active_record/relation/finder_methods.rb:274: warning: ambiguous first argument; put parentheses or a space even after `-' operator ```
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/active_record/relation/finder_methods.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/activerecord/lib/active_record/relation/finder_methods.rb b/activerecord/lib/active_record/relation/finder_methods.rb
index 90a6a466fd..a4280c5f33 100644
--- a/activerecord/lib/active_record/relation/finder_methods.rb
+++ b/activerecord/lib/active_record/relation/finder_methods.rb
@@ -249,13 +249,13 @@ module ActiveRecord
# Person.offset(3).third_to_last # returns the third-to-last object from OFFSET 3
# Person.where(["user_name = :u", { u: user_name }]).third_to_last
def third_to_last
- find_nth -3
+ find_nth(-3)
end
# Same as #third_to_last but raises ActiveRecord::RecordNotFound if no record
# is found.
def third_to_last!
- find_nth! -3
+ find_nth!(-3)
end
# Find the second-to-last record.
@@ -265,13 +265,13 @@ module ActiveRecord
# Person.offset(3).second_to_last # returns the second-to-last object from OFFSET 3
# Person.where(["user_name = :u", { u: user_name }]).second_to_last
def second_to_last
- find_nth -2
+ find_nth(-2)
end
# Same as #second_to_last but raises ActiveRecord::RecordNotFound if no record
# is found.
def second_to_last!
- find_nth! -2
+ find_nth!(-2)
end
# Returns true if a record exists in the table that matches the +id+ or