Permalink
Browse files

Merge branch '3-2-15' into 3-2-sec

* 3-2-15:
  bumping to rc3
  Revert "Merge pull request #12413 from arthurnn/inverse_of_on_build"
  Revert "Merge pull request #12443 from arthurnn/add_inverse_of_add_target"
  bumping to rc2
  Merge pull request #12443 from arthurnn/add_inverse_of_add_target
  bumping version to 3.2.15.rc1
  Fix STI scopes using benolee's suggestion. Fixes #11939
  • Loading branch information...
tenderlove committed Oct 15, 2013
2 parents befeeb2 + e3abd78 commit eb8807e84dff1b726051946bf09336f36aaae93e
View
@@ -1 +1 @@
-3.2.14
+3.2.15.rc3
@@ -2,8 +2,8 @@ module ActionMailer
module VERSION #:nodoc:
MAJOR = 3
MINOR = 2
- TINY = 14
- PRE = nil
+ TINY = 15
+ PRE = "rc3"
STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.')
end
@@ -2,8 +2,8 @@ module ActionPack
module VERSION #:nodoc:
MAJOR = 3
MINOR = 2
- TINY = 14
- PRE = nil
+ TINY = 15
+ PRE = "rc3"
STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.')
end
@@ -2,8 +2,8 @@ module ActiveModel
module VERSION #:nodoc:
MAJOR = 3
MINOR = 2
- TINY = 14
- PRE = nil
+ TINY = 15
+ PRE = "rc3"
STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.')
end
@@ -1,10 +1,4 @@
## unreleased ##
-* Move .set_inverse_instance call to association.build_record method. Everytime a new record is build
- using the association, we need to try to set the inverse_of relation.
-
- Fixes #10371.
-
- *arthurnn*
* When calling the method .find_or_initialize_by_* from a collection_proxy
it should set the inverse_of relation even when the entry was found on the db.
@@ -240,7 +240,6 @@ def build_record(attributes, options)
skip_assign = [reflection.foreign_key, reflection.type].compact
attributes = create_scope.except(*(record.changed - skip_assign))
record.assign_attributes(attributes, :without_protection => true)
- set_inverse_instance(record)
end
end
end
@@ -350,6 +350,7 @@ def add_to_target(record)
end
callback(:after_add, record)
+ set_inverse_instance(record)
record
end
@@ -151,7 +151,7 @@ def merge_joins(relation, other)
values = other.joins_values
return if values.blank?
- if other.klass == relation.klass
+ if other.klass >= relation.klass
relation.joins_values += values
else
joins_dependency, rest = values.partition do |join|
@@ -2,8 +2,8 @@ module ActiveRecord
module VERSION #:nodoc:
MAJOR = 3
MINOR = 2
- TINY = 14
- PRE = nil
+ TINY = 15
+ PRE = "rc3"
STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.')
end
@@ -125,10 +125,8 @@ def test_parent_instance_should_be_shared_with_newly_built_child
end
def test_parent_instance_should_be_shared_with_newly_created_child
- m = Man.create
+ m = Man.find(:first)
f = m.create_face(:description => 'haunted')
-
- assert_equal m.object_id, f.man.object_id
assert_not_nil f.man
assert_equal m.name, f.man.name, "Name of man should be the same before changes to parent instance"
m.name = 'Bongo'
@@ -236,6 +236,11 @@ def test_inheritance_without_mapping
assert_nothing_raised { s = SpecialSubscriber.new("name" => "And breaaaaathe!"); s.id = 'roger'; s.save }
end
+ def test_scope_inherited_properly
+ assert_nothing_raised { Company.of_first_firm }
+ assert_nothing_raised { Client.of_first_firm }
+ end
+
private
def switch_to_alt_inheritance_column
# we don't want misleading test results, so get rid of the values in the type column
@@ -12,6 +12,11 @@ class Company < AbstractCompany
has_many :contracts
has_many :developers, :through => :contracts
+ scope :of_first_firm, lambda {
+ joins(:account => :firm).
+ where('firms.id' => 1)
+ }
+
def arbitrary_method
"I am Jack's profound disappointment"
end
@@ -2,8 +2,8 @@ module ActiveResource
module VERSION #:nodoc:
MAJOR = 3
MINOR = 2
- TINY = 14
- PRE = nil
+ TINY = 15
+ PRE = "rc3"
STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.')
end
@@ -2,8 +2,8 @@ module ActiveSupport
module VERSION #:nodoc:
MAJOR = 3
MINOR = 2
- TINY = 14
- PRE = nil
+ TINY = 15
+ PRE = "rc3"
STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.')
end
@@ -2,8 +2,8 @@ module Rails
module VERSION #:nodoc:
MAJOR = 3
MINOR = 2
- TINY = 14
- PRE = nil
+ TINY = 15
+ PRE = "rc3"
STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.')
end
View
@@ -2,8 +2,8 @@ module Rails
module VERSION #:nodoc:
MAJOR = 3
MINOR = 2
- TINY = 14
- PRE = nil
+ TINY = 15
+ PRE = "rc3"
STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.')
end

0 comments on commit eb8807e

Please sign in to comment.