1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activerecord/test/models/car.rb
Neeraj Singh 2e45542942 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>
2010-08-19 14:52:15 -03:00

10 lines
211 B
Ruby

class Car < ActiveRecord::Base
has_many :bulbs
has_many :tyres
has_many :engines
has_many :wheels, :as => :wheelable
scope :incl_tyres, includes(:tyres)
scope :incl_engines, includes(:engines)
end