| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
| |
Fix the `:primary_key` option for `has_many` associations.
Conflicts:
activerecord/CHANGELOG.md
activerecord/lib/active_record/associations/has_many_association.rb
|
| |
|
|
|
|
|
|
|
|
|
| |
Backport #7536 to fix #8968.
Conflicts:
activerecord/CHANGELOG.md
activerecord/lib/active_record/relation/calculations.rb
|
|
|
|
|
|
|
|
|
|
| |
Fix #8575
Conflicts:
activerecord/CHANGELOG.md
activerecord/lib/active_record/attribute_methods/serialization.rb
activerecord/test/cases/serialized_attribute_test.rb
activerecord/test/models/person.rb
|
|
|
|
|
|
| |
This can be done using the class attribute cache_timestamp_format
Closes #8195
|
| |
|
|
|
|
|
|
|
|
|
| |
Closes #3313
Conflicts:
activerecord/CHANGELOG.md
activerecord/test/models/developer.rb
|
|\
| |
| |
| |
| |
| |
| | |
Use nil? instead of blank? to check dynamic finder result
Conflicts:
activerecord/CHANGELOG.md
|
| |
| |
| |
| |
| |
| |
| | |
It's safe to use `nil?` instead of `blank?` because it's impossible to get an array on finder with bang;
`all_by` finder matches against regex without bang: `when /^find_(all_|last_)?by_([_a-zA-Z]\w*)$/`.
Fixes #7238
|
|/
|
|
| |
with optimistic locking enabled. Fixes #5332.
|
|
|
|
|
|
|
| |
Fix reset_counters crashing on has_many :through associations.
Conflicts:
activerecord/CHANGELOG.md
activerecord/lib/active_record/counter_cache.rb
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I had to create a new table because I needed an STI table,
which does not have both a "type" and a "custom_type"
the test fails with:
1) Error:
test_alt_becomes_works_with_sti(InheritanceTest):
NoMethodError: undefined method `type=' for #<Cabbage id: 1, name: "my cucumber", custom_type: "Cucumber">
/Users/username/Projects/rails/activemodel/lib/active_model/attribute_methods.rb:432:in `method_missing'
/Users/username/Projects/rails/activerecord/lib/active_record/attribute_methods.rb:100:in `method_missing'
/Users/username/Projects/rails/activerecord/lib/active_record/persistence.rb:165:in `becomes'
test/cases/inheritance_test.rb:134:in `test_becomes_works_with_sti'
test/cases/inheritance_test.rb:140:in `test_alt_becomes_works_with_sti'
Conflicts:
activerecord/test/cases/inheritance_test.rb
|
|
|
|
|
|
|
|
| |
conditions
Conflicts:
activerecord/test/models/reader.rb
|
|
|
|
| |
Introduced in backport 648c5a1369ed64608c3ca43a5ebc917687d20010.
|
|
|
|
|
|
|
|
| |
Fix for #5200
Conflicts:
activerecord/CHANGELOG.md
activerecord/lib/active_record/counter_cache.rb
|
| |
|
|
|
|
| |
This reverts commit 44b313bc4e3762da64dde7894548f81c595147de.
|
|
|
|
|
|
|
|
|
|
| |
This reverts commit a79bfa92e7bdc31b346d13ee5447d3fdac382bfb.
Conflicts:
activerecord/CHANGELOG.md
We shouldn't introducing deprecations in point releases.
It will be deprecated in 4.0 instead.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This feature adds a lot of complication to ActiveRecord for dubious
value. Let's talk about what it does currently:
class Customer < ActiveRecord::Base
composed_of :balance, :class_name => "Money", :mapping => %w(balance
amount)
end
Instead, you can do something like this:
def balance
@balance ||= Money.new(value, currency)
end
def balance=(balance)
self[:value] = balance.value
self[:currency] = balance.currency
@balance = balance
end
Since that's fairly easy code to write, and doesn't need anything
extra from the framework, if you use composed_of today, you'll
have to add accessors/mutators like that.
This feature will be removed in Rails 4.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A series of commits relating to preloading and scopes caused a regression.
Cloning the relation calls initialize_copy which resets a number of instance
variables to nil. Without this the scope thinks that it is already loaded
when it is called again.
Reverts the following commits:
13f1401a6cf0266a3b0a91b173f976db2d4e50f3
8491740ca5361ba9df20e1c8b906c709f5bfbc12
dffbb521a0d00c8673a3ad6e0e8ff526f32daf4e
Fixes #6575, #6576 & #6577
|
|
|
|
|
|
|
|
| |
(as described in #5667)
Conflicts:
activerecord/test/cases/associations/eager_test.rb
|
|
|
|
|
|
|
| |
Also skip persistente tests related to UPDATE + ORDER BY for postgresql
PostgreSQL does not support updates with order by, and these tests are
failing randomly depending on the fixture loading order now.
|
| |
|
|
|
|
|
|
|
|
| |
:strict
Conflicts:
activerecord/test/models/person.rb
|
| |
|
|
|
|
| |
ids_reader method fixed, test added to has_many association (for PostgreSQL)
|
|
|
|
| |
Fix bug where reset_counters resets the wrong counter cache.
|
| |
|
|
|
|
|
|
| |
strict mass assignment sanitizer, fixed build_record to not merge creation_attributes, removed failing nested attributes tests (that feature was broken anyway) #4051
Signed-off-by: José Valim <jose.valim@gmail.com>
|
| |
|
|
|
|
| |
object. Fixes a regression from 3.0.x
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
method.
|
| |
|
| |
|
|
|
|
|
| |
This is to avoid confusing newbies, and to be consistent with the fact
that other options like :foreign_key already allow a symbol or a string.
|
| |
|
|
|
|
| |
stores [DHH]
|
|
|
|
|
|
|
|
|
| |
Previously we would just silently write the attribute. This can lead to
subtle bugs (for example, see the change in AutosaveAssociation where a
through association would wrongly gain an attribute.
Also, ensuring that we never gain any new attributes after
initialization will allow me to reduce our dependence on method_missing.
|
| |
|
|
|
|
| |
HasManyAssociation#inverse_updates_counter_cache?. Fixes #2755, where a counter cache could be decremented twice as far as it was supposed to be.
|
|
|
| |
Fixes #2832
|
|
|
|
| |
therefore counted by the alias tracker. This is because the association_joins are aliased on initialization and then the tables are cached, so it is no use to alias the join_nodes later. Fixes #2556.
|
| |
|