aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/models/bulb.rb
diff options
context:
space:
mode:
authorNeeraj Singh <neerajdotname@gmail.com>2010-08-12 21:37:48 -0400
committerJosé Valim <jose.valim@gmail.com>2010-08-19 14:52:15 -0300
commit2e455429427a4078d2888cc39305f951bdf1e643 (patch)
treeb67aa66e66704aca116fd90f72144528aab563b4 /activerecord/test/models/bulb.rb
parent43f44c1a034497fef0a9ed64e0da6f090b5c3b7e (diff)
downloadrails-2e455429427a4078d2888cc39305f951bdf1e643.tar.gz
rails-2e455429427a4078d2888cc39305f951bdf1e643.tar.bz2
rails-2e455429427a4078d2888cc39305f951bdf1e643.zip
While creating a new record using has_many create method default scope of child should be respected.
author.posts.create should take into account default_scope defined on post. [#3939: state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'activerecord/test/models/bulb.rb')
-rw-r--r--activerecord/test/models/bulb.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/activerecord/test/models/bulb.rb b/activerecord/test/models/bulb.rb
new file mode 100644
index 0000000000..9eefc5803a
--- /dev/null
+++ b/activerecord/test/models/bulb.rb
@@ -0,0 +1,7 @@
+class Bulb < ActiveRecord::Base
+
+ default_scope :conditions => {:name => 'defaulty' }
+
+ belongs_to :car
+
+end