From 84af99e78dbf65b7faa92313acf8457cb0c2b510 Mon Sep 17 00:00:00 2001 From: Daniel Guettler Date: Wed, 9 Jul 2008 14:08:04 +0100 Subject: Ensure NamedScope#build/create/create!/new works as expected when named scope has hash conditions. [Daniel Guettler, Pratik Naik] [#419 state:resolved] Signed-off-by: Pratik Naik --- activerecord/test/models/topic.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'activerecord/test/models/topic.rb') diff --git a/activerecord/test/models/topic.rb b/activerecord/test/models/topic.rb index 47b2eec938..39ca1bf42a 100755 --- a/activerecord/test/models/topic.rb +++ b/activerecord/test/models/topic.rb @@ -4,6 +4,8 @@ class Topic < ActiveRecord::Base { :conditions => ['written_on < ?', time] } } named_scope :approved, :conditions => {:approved => true} + named_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'] -- cgit v1.2.3