diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-04-03 17:13:24 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2014-04-03 17:13:24 -0300 |
commit | ae110ce5d4de8cb3a22f826b0e824f333d2b2742 (patch) | |
tree | 41065be39c3ba3df5d7a02740f105911978f24db /activerecord/test/models | |
parent | 6da3e9ad5bf38ea54135424f360df49495c07afe (diff) | |
parent | db5d26c9d70fb72b8aa3ea98709224dd13800024 (diff) | |
download | rails-ae110ce5d4de8cb3a22f826b0e824f333d2b2742.tar.gz rails-ae110ce5d4de8cb3a22f826b0e824f333d2b2742.tar.bz2 rails-ae110ce5d4de8cb3a22f826b0e824f333d2b2742.zip |
Merge pull request #14572 from laurocaetano/with_options_and_scope
Fix error when using `with_options` with lambda.
Conflicts:
activerecord/CHANGELOG.md
Diffstat (limited to 'activerecord/test/models')
-rw-r--r-- | activerecord/test/models/college.rb | 5 | ||||
-rw-r--r-- | activerecord/test/models/student.rb | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/activerecord/test/models/college.rb b/activerecord/test/models/college.rb index c7495d7deb..501af4a8dd 100644 --- a/activerecord/test/models/college.rb +++ b/activerecord/test/models/college.rb @@ -1,5 +1,10 @@ require_dependency 'models/arunit2_model' +require 'active_support/core_ext/object/with_options' class College < ARUnit2Model has_many :courses + + with_options dependent: :destroy do |assoc| + assoc.has_many :students, -> { where(active: true) } + end end diff --git a/activerecord/test/models/student.rb b/activerecord/test/models/student.rb index f459f2a9a3..28a0b6c99b 100644 --- a/activerecord/test/models/student.rb +++ b/activerecord/test/models/student.rb @@ -1,3 +1,4 @@ class Student < ActiveRecord::Base has_and_belongs_to_many :lessons + belongs_to :college end |