| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
Fix bug with autosave collection association on new record with a marked
for destroy record in autosave collection.
Fixes #6918.
|
|
|
|
|
|
| |
fix bug in limit of enum columns of mysql
Closes #6432
|
|
|
|
|
|
|
|
| |
Fix build issue with postgresql.
Conflicts:
activerecord/lib/active_record/relation/calculations.rb
activerecord/test/cases/calculations_test.rb
|
|
|
|
|
|
| |
Stop assuming strings for grouped calculations
Conflicts:
activerecord/lib/active_record/relation/calculations.rb
|
| |
|
|
|
|
|
|
|
| |
Closes #6675
Conflicts:
activerecord/lib/active_record/attribute_methods/dirty.rb
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
Before b081f6b59fb3f15d12043072ad9b331ffd2bc56e, this test are
asserting that update_attribute does the dirty tracking. Since we
deprecated this method and update_column write in the database directly
this tests will always fail.
|
|
|
|
|
|
|
|
|
|
|
| |
Historically, update_attribute and update_attributes are similar, but
with one big difference: update_attribute does not run validations.
These two methods are really easy to confuse given their similar
names. Therefore, update_attribute is being deprecated in favor of
update_column, and will be removed in Rails 4.
See the discussion on rails-core here:
https://groups.google.com/d/topic/rubyonrails-core/BWPUTK7WvYA/discussion
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* 3-2-stable-rel:
updating changelogs
bumping version numbers
updating changelogs with security fixes
updating changelogs
Array parameters should not contain nil values.
Additional fix for CVE-2012-2661
|
| |
| |
| |
| |
| |
| |
| |
| | |
While the patched PredicateBuilder in 3.1.5 prevents a user
from specifying a table name using the `table.column` format,
it doesn't protect against the nesting of hashes changing the
table context in the next call to build_from_hash. This fix
covers this case as well.
|
| |
| |
| |
| | |
Need a assert here in tests
|
|/
|
|
| |
Don't assign the attributes if the list is empty
|
|
|
|
|
|
|
| |
Conflicts:
activerecord/test/cases/adapters/mysql/mysql_adapter_test.rb
activerecord/test/cases/adapters/mysql2/schema_test.rb
|
|
|
|
|
|
| |
Conflicts:
activerecord/test/cases/adapters/mysql/mysql_adapter_test.rb
|
|
|
|
| |
Address ORA-00911 errors because of the heading underscore.
|
|
|
|
|
|
| |
Fix that #exists? can blow up with ThrowResult exception
Conflicts:
activerecord/lib/active_record/relation/finder_methods.rb
|
| |
|
|
|
|
|
|
|
|
| |
This behavior was added in dd286a4c735dac1db8c9262581c7f29c44d1f695
Closes #1139.
Fixes #2553, #1141, #1623 and #2062.
|
|
|
|
| |
Fix #6635. We should call Scoping methods, before calling Array methods.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
This reverts commit b98d1e21635d8776de8893cc09bd86c71f6c78f0.
Closes #6609
Conflicts:
activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb
|
| |
|
|
|
|
|
|
|
| |
adapter.
Because Oracle adapter supports only remove_column :table_name, :column_name syntax
and it has never supported remove_column :table_name, [:column_name].
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|\
| |
| |
| |
| |
| |
| | |
* 3-2-stable-sec:
Strip [nil] from parameters hash. Thanks to Ben Murphy for reporting this!
predicate builder should not recurse for determining where columns. Thanks to Ben Murphy for reporting this
bumping to 3.2.4.rc1
|
| |
| |
| |
| |
| |
| | |
Thanks to Ben Murphy for reporting this
CVE-2012-2661
|
|/
|
|
|
|
| |
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
|
| | |
|