diff options
author | Jon Leighton <j@jonathanleighton.com> | 2011-04-18 23:15:38 +0100 |
---|---|---|
committer | Jon Leighton <j@jonathanleighton.com> | 2011-04-18 23:15:38 +0100 |
commit | 6f84c73dc48538202766cff3d973a53d3c30848e (patch) | |
tree | b95728dfe8813ad3637fbe3a1e52c9207279663d /activerecord/test/models/post.rb | |
parent | 0acc6bd6cb1d27fdbb0c00ac3a322bc8413e03cc (diff) | |
download | rails-6f84c73dc48538202766cff3d973a53d3c30848e.tar.gz rails-6f84c73dc48538202766cff3d973a53d3c30848e.tar.bz2 rails-6f84c73dc48538202766cff3d973a53d3c30848e.zip |
Un-deprecate using 'default_scope' as a macro, but if you are calling the macro multiple times that will give deprecation warnings, and in 3.2 we will simply overwrite the default scope when you call the macro multiple times.
Diffstat (limited to 'activerecord/test/models/post.rb')
-rw-r--r-- | activerecord/test/models/post.rb | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/activerecord/test/models/post.rb b/activerecord/test/models/post.rb index 34cea60053..80296032bb 100644 --- a/activerecord/test/models/post.rb +++ b/activerecord/test/models/post.rb @@ -157,10 +157,7 @@ end class FirstPost < ActiveRecord::Base self.table_name = 'posts' - - def self.default_scope - where(:id => 1) - end + default_scope where(:id => 1) has_many :comments, :foreign_key => :post_id has_one :comment, :foreign_key => :post_id |