From f0cde5be541e1f3877a15fb5d39c87a487a14381 Mon Sep 17 00:00:00 2001 From: Pratik Naik Date: Sun, 17 Jan 2010 21:34:26 +0530 Subject: Make sure named_scope names are not used as method names already --- activerecord/test/models/post.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'activerecord/test/models') 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 -- cgit v1.2.3