aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/models
diff options
context:
space:
mode:
authorPratik Naik <pratiknaik@gmail.com>2010-01-17 21:34:26 +0530
committerPratik Naik <pratiknaik@gmail.com>2010-01-17 21:34:41 +0530
commitf0cde5be541e1f3877a15fb5d39c87a487a14381 (patch)
tree6abf7fcf3f868e3ad827f6b5ca9f6e1f3618d4bf /activerecord/test/models
parent5a6596787b9489c62d149b61935057cee3dcf61a (diff)
downloadrails-f0cde5be541e1f3877a15fb5d39c87a487a14381.tar.gz
rails-f0cde5be541e1f3877a15fb5d39c87a487a14381.tar.bz2
rails-f0cde5be541e1f3877a15fb5d39c87a487a14381.zip
Make sure named_scope names are not used as method names already
Diffstat (limited to 'activerecord/test/models')
-rw-r--r--activerecord/test/models/post.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/test/models/post.rb b/activerecord/test/models/post.rb
index 7392515ec7..662f75c39f 100644
--- a/activerecord/test/models/post.rb
+++ b/activerecord/test/models/post.rb
@@ -1,7 +1,7 @@
class Post < ActiveRecord::Base
named_scope :containing_the_letter_a, :conditions => "body LIKE '%a%'"
named_scope :ranked_by_comments, :order => "comments_count DESC"
- named_scope :limit, lambda {|limit| {:limit => limit} }
+ named_scope :limit_by, lambda {|limit| {:limit => limit} }
named_scope :with_authors_at_address, lambda { |address| {
:conditions => [ 'authors.author_address_id = ?', address.id ],
:joins => 'JOIN authors ON authors.id = posts.author_id'
@@ -73,7 +73,7 @@ class Post < ActiveRecord::Base
has_many :impatient_people, :through => :skimmers, :source => :person
def self.top(limit)
- ranked_by_comments.limit(limit)
+ ranked_by_comments.limit_by(limit)
end
def self.reset_log