aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/models/topic.rb
diff options
context:
space:
mode:
authorPratik Naik <pratiknaik@gmail.com>2010-01-18 04:38:19 +0530
committerPratik Naik <pratiknaik@gmail.com>2010-01-18 04:38:19 +0530
commitd60bb0a9e4be2ac0a9de9a69041a4ddc2e0cc914 (patch)
tree0189bf9fe9888963df51987e5e330b09e2e19b59 /activerecord/test/models/topic.rb
parente1d507c7fb541d29d57d152f40e3a539e70781d0 (diff)
downloadrails-d60bb0a9e4be2ac0a9de9a69041a4ddc2e0cc914.tar.gz
rails-d60bb0a9e4be2ac0a9de9a69041a4ddc2e0cc914.tar.bz2
rails-d60bb0a9e4be2ac0a9de9a69041a4ddc2e0cc914.zip
Rename named_scope to scope
Diffstat (limited to 'activerecord/test/models/topic.rb')
-rw-r--r--activerecord/test/models/topic.rb22
1 files changed, 11 insertions, 11 deletions
diff --git a/activerecord/test/models/topic.rb b/activerecord/test/models/topic.rb
index baca4972cb..91fc7c9416 100644
--- a/activerecord/test/models/topic.rb
+++ b/activerecord/test/models/topic.rb
@@ -1,19 +1,19 @@
class Topic < ActiveRecord::Base
- named_scope :base
- named_scope :written_before, lambda { |time|
+ scope :base
+ scope :written_before, lambda { |time|
if time
{ :conditions => ['written_on < ?', time] }
end
}
- named_scope :approved, :conditions => {:approved => true}
- named_scope :rejected, :conditions => {:approved => false}
+ scope :approved, :conditions => {:approved => true}
+ scope :rejected, :conditions => {:approved => false}
- named_scope :by_lifo, :conditions => {:author_name => 'lifo'}
+ scope :by_lifo, :conditions => {:author_name => 'lifo'}
- named_scope :approved_as_hash_condition, :conditions => {:topics => {:approved => true}}
- named_scope 'approved_as_string', :conditions => {:approved => true}
- named_scope :replied, :conditions => ['replies_count > 0']
- named_scope :anonymous_extension do
+ scope :approved_as_hash_condition, :conditions => {:topics => {:approved => true}}
+ scope 'approved_as_string', :conditions => {:approved => true}
+ scope :replied, :conditions => ['replies_count > 0']
+ scope :anonymous_extension do
def one
1
end
@@ -33,8 +33,8 @@ class Topic < ActiveRecord::Base
2
end
end
- named_scope :named_extension, :extend => NamedExtension
- named_scope :multiple_extensions, :extend => [MultipleExtensionTwo, MultipleExtensionOne]
+ scope :named_extension, :extend => NamedExtension
+ scope :multiple_extensions, :extend => [MultipleExtensionTwo, MultipleExtensionOne]
has_many :replies, :dependent => :destroy, :foreign_key => "parent_id"
has_many :replies_with_primary_key, :class_name => "Reply", :dependent => :destroy, :primary_key => "title", :foreign_key => "parent_title"