From 9dccf008e1545415143dccc3d7406c6f34b6628f Mon Sep 17 00:00:00 2001 From: Carlos Antonio da Silva Date: Wed, 1 Feb 2012 15:35:07 -0200 Subject: Fix code example in ActiveRecord::Relation#none --- activerecord/lib/active_record/relation/query_methods.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'activerecord') diff --git a/activerecord/lib/active_record/relation/query_methods.rb b/activerecord/lib/active_record/relation/query_methods.rb index 6a28d7b155..6f464d6ad0 100644 --- a/activerecord/lib/active_record/relation/query_methods.rb +++ b/activerecord/lib/active_record/relation/query_methods.rb @@ -216,11 +216,11 @@ module ActiveRecord # # def visible_posts # case role - # if 'Country Manager' + # when 'Country Manager' # Post.where(:country => country) - # if 'Reviewer' + # when 'Reviewer' # Post.published - # if 'Bad User' + # when 'Bad User' # Post.none # => returning [] instead breaks the previous code # end # end -- cgit v1.2.3 From 2f97eaea0eade22b70c08dda78cd9601379212bd Mon Sep 17 00:00:00 2001 From: Rohit Arondekar Date: Mon, 6 Feb 2012 17:20:30 +0530 Subject: minor tidy up of none relation query method --- activerecord/lib/active_record/relation/query_methods.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'activerecord') diff --git a/activerecord/lib/active_record/relation/query_methods.rb b/activerecord/lib/active_record/relation/query_methods.rb index 6f464d6ad0..b4f21410c1 100644 --- a/activerecord/lib/active_record/relation/query_methods.rb +++ b/activerecord/lib/active_record/relation/query_methods.rb @@ -206,8 +206,8 @@ module ActiveRecord # Any subsequent condition chained to the returned relation will continue # generating an empty relation and will not fire any query to the database. # - # Used in cases where is needed a method or a scope that could return zero - # results but the response has to be chainable. + # Used in cases where a method or scope could return zero results but the + # response needs to be chainable. # # For example: # -- cgit v1.2.3 From 80d3a0e16e8a3e7f02fc85a0136b52b3a1a19ebc Mon Sep 17 00:00:00 2001 From: Rohit Arondekar Date: Tue, 7 Feb 2012 10:09:51 +0530 Subject: use appropriate words for docs of Model.none --- activerecord/lib/active_record/relation/query_methods.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'activerecord') diff --git a/activerecord/lib/active_record/relation/query_methods.rb b/activerecord/lib/active_record/relation/query_methods.rb index b4f21410c1..cc4ef2d078 100644 --- a/activerecord/lib/active_record/relation/query_methods.rb +++ b/activerecord/lib/active_record/relation/query_methods.rb @@ -206,8 +206,8 @@ module ActiveRecord # Any subsequent condition chained to the returned relation will continue # generating an empty relation and will not fire any query to the database. # - # Used in cases where a method or scope could return zero results but the - # response needs to be chainable. + # Used in cases where a method or scope could return zero records but the + # result needs to be chainable. # # For example: # -- cgit v1.2.3 From 89f2c94c22421cffb887f70a01362dcd747ae49a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josef=20=C5=A0im=C3=A1nek?= Date: Tue, 7 Feb 2012 06:09:08 +0100 Subject: Correcting ActiveRecord::Core#encode_with docs --- activerecord/lib/active_record/core.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activerecord') diff --git a/activerecord/lib/active_record/core.rb b/activerecord/lib/active_record/core.rb index a2ce620354..97ffd11f2d 100644 --- a/activerecord/lib/active_record/core.rb +++ b/activerecord/lib/active_record/core.rb @@ -243,7 +243,7 @@ module ActiveRecord # end # coder = {} # Post.new.encode_with(coder) - # coder # => { 'id' => nil, ... } + # coder # => {"attributes" => {"id" => nil, ... }} def encode_with(coder) coder['attributes'] = attributes end -- cgit v1.2.3