diff options
author | Sean Griffin <sean@seantheprogrammer.com> | 2015-11-16 12:43:59 -0600 |
---|---|---|
committer | Sean Griffin <sean@seantheprogrammer.com> | 2015-11-16 12:43:59 -0600 |
commit | bde974f418e2de7095fd6fd19c1e72b0c749fc30 (patch) | |
tree | 36beb89e311913c8619b03d3e0da2afcbe3e1804 /activerecord/test/models | |
parent | 0f78936eac10f49e787658642ffec0b4abe6c9ef (diff) | |
parent | 817c1825c15013fd0180762ac5c05a2e024a640d (diff) | |
download | rails-bde974f418e2de7095fd6fd19c1e72b0c749fc30.tar.gz rails-bde974f418e2de7095fd6fd19c1e72b0c749fc30.tar.bz2 rails-bde974f418e2de7095fd6fd19c1e72b0c749fc30.zip |
Merge pull request #22300 from yui-knk/fix_21893
Except keys of `build_record`'s argument from `create_scope` in initiā¦
Diffstat (limited to 'activerecord/test/models')
-rw-r--r-- | activerecord/test/models/bulb.rb | 1 | ||||
-rw-r--r-- | activerecord/test/models/car.rb | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/activerecord/test/models/bulb.rb b/activerecord/test/models/bulb.rb index a6e83fe353..c1e491e5c5 100644 --- a/activerecord/test/models/bulb.rb +++ b/activerecord/test/models/bulb.rb @@ -1,6 +1,7 @@ class Bulb < ActiveRecord::Base default_scope { where(:name => 'defaulty') } belongs_to :car, :touch => true + scope :awesome, -> { where(frickinawesome: true) } attr_reader :scope_after_initialize, :attributes_after_initialize diff --git a/activerecord/test/models/car.rb b/activerecord/test/models/car.rb index 81263b79d1..778c22b1f6 100644 --- a/activerecord/test/models/car.rb +++ b/activerecord/test/models/car.rb @@ -4,6 +4,7 @@ class Car < ActiveRecord::Base has_many :funky_bulbs, class_name: 'FunkyBulb', dependent: :destroy has_many :failed_bulbs, class_name: 'FailedBulb', dependent: :destroy has_many :foo_bulbs, -> { where(:name => 'foo') }, :class_name => "Bulb" + has_many :awesome_bulbs, -> { awesome }, class_name: "Bulb" has_one :bulb |