| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|/
|
|
|
|
| |
Fix #5797. Error calling dup method on AR model with serialized field
Conflicts:
activerecord/lib/active_record/core.rb
|
|
|
|
|
|
|
|
| |
Ruby 1.8 raises a TypeError when trying to modify a frozen Hash, while
Ruby 1.9 raises a RuntimeError instead. Also, Ruby < 1.9.3 uses a
lowercase 'hash' in the exception message while Ruby >= 1.9.3 uses an
uppercase 'Hash' instead. This commit normalizes those issues in the
test case.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a 3-2-stable backport for #6420 which was merged into master.
Currently, when saving a frozen record, an exception would be thrown
which causes a rollback. However, there is a bug in active record that
"defrost" the record as a side effect:
>> t = Topic.new
=> #<Topic id: nil, ...>
>> t.freeze
=> #<Topic id: nil, ...>
>> t.save
RuntimeError: can't modify a frozen Hash
>> t.frozen?
=> false
>> t.save
=> true
This patch fixes the bug by explictly restoring the frozen state on the
attributes Hash after every rollback.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Closes (#5853)
Uniqueness validator was not properly checking if there are any existing
records, when value was `nil` and column was text type. `nil` was
converted to string, which resulted in queries looking like:
```sql
SELECT 1 FROM "posts" WHERE "posts"."title" = '' LIMIT 1
```
instead of
```sql
SELECT 1 FROM "posts" WHERE "posts"."title" IS NULL LIMIT 1
```
|
|
|
|
|
|
|
|
| |
The fix commited in e2a070c was returning the `new_target`, as
a try to return whatever user replaced association with. The
problem is, the resulting association target may be ordered
differently. In such case we want to return the target that
will be later used for that association.
|
| |
|
|
|
|
|
|
|
|
| |
Bug #6289
Conflicts:
activerecord/test/cases/associations/has_many_associations_test.rb
|
|
|
|
|
|
| |
Conflicts:
activerecord/test/cases/associations/has_many_associations_test.rb
|
|
|
|
| |
(cherry picked from commit fa21b73ebb8339ad388f149c817c433b6254d490)
|
| |
|
|\
| |
| | |
Fix #4979 against 3-2-stable
|
| | |
|
|/ |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
option
Backports #5900
Conflicts:
activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb
activerecord/test/cases/adapters/mysql/mysql_adapter_test.rb
|
|
|
|
|
|
|
|
| |
(as described in #5667)
Conflicts:
activerecord/test/cases/associations/eager_test.rb
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The #relation method gets called in four places and the return value was instantly cloned in three of them. The only place that did not clone was ActiveRecord::Scoping::Default::ClassMethods#unscoped. This introduced a bug described in #5667 and should really clone the relation, too. This means all four places would clone the relation, so it doesn't make a lot of sense caching it in the first place.
The four places with calls to relations are:
activerecord/lib/active_record/scoping/default.rb:110:in `block in build_default_scope'"
activerecord/lib/active_record/scoping/default.rb:42:in `unscoped'"
activerecord/lib/active_record/scoping/named.rb:38:in `scoped'"
activerecord/lib/active_record/scoping/named.rb:52:in `scope_attributes'"
Conflicts:
activerecord/lib/active_record/core.rb
|
|
|
|
|
|
|
|
| |
Causes a subtle regression where record.reload includes the default
scope. Hard to reproduce in isolation. Seems like the relation is
getting infected by some previous usage.
This reverts commit dffbb521a0d00c8673a3ad6e0e8ff526f32daf4e.
|
| |
|
|\
| |
| | |
Fixing Identity Map when using find select in rails 3.2
|
| |
| |
| |
| | |
it's more readable
|
| | |
|
|/
|
|
|
|
| |
Conflicts:
activerecord/test/cases/associations/eager_test.rb
|
|\
| |
| | |
Address an error for test_has_many_through_polymorphic_has_one with Oracle
|
| |
| |
| |
| | |
to address ORA-00918 error
|
| |
| |
| |
| |
| |
| |
| |
| | |
Cherry-picked from e96d04a2e4e244ea5053cb4e8ab97db604d0c796.
Conflicts:
activerecord/lib/active_record/attribute_methods/read.rb
|
|/
|
|
| |
backport ddb5d2f756d9d2655a07791a3b62832efd588474 to 3-2-stable
|
|\
| |
| | |
[3-2-stable] migrate(:down) method with table_name_prefix
|
| | |
|
| | |
|
|/
|
|
|
|
|
| |
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.
|
|
|
|
| |
Fix GH #5430. A Payload name for schema_search_path should be SCHEMA.
|
|
|
|
| |
ActiveRecord::Base::ConnectionSpecification objects.
|
|
|
|
|
|
| |
add test to show offset query_methods on mysql & mysql2
change test to cover public API
|
| |
|
|
|
|
|
|
|
|
|
| |
(cherry picked from commit 5282485d310d1a6ffcf55e4e7f56ab234e16880d)
Conflicts:
activerecord/CHANGELOG.md
activerecord/lib/active_record/dynamic_finder_match.rb
|
| |
|
|
|
|
|
|
|
|
| |
:strict
Conflicts:
activerecord/test/models/person.rb
|
| |
|
|
|
|
| |
use for the current thread. fixes #5330
|
|
|
|
| |
update the records we retrive from the association
|
|
|
|
| |
Update ActiveRecord::AttributeMethods#attribute_present? to return false for empty strings
|
|
|
|
| |
builder
|
| |
|
|
|
|
|
|
| |
Conflicts:
activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb
|
| |
|
|
|
|
| |
Restoring ability to derive id/sequence from tables with nonstandard sequences for primary keys
|
| |
|