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/college.rb

11 lines
260 B
Ruby
Raw Normal View History

2012-02-10 17:35:22 -05:00
require_dependency 'models/arunit2_model'
require 'active_support/core_ext/object/with_options'
2012-02-10 17:35:22 -05:00
class College < ARUnit2Model
has_many :courses
with_options dependent: :destroy do |assoc|
assoc.has_many :students, -> { where(active: true) }
end
2012-02-10 17:35:22 -05:00
end