- 19 6月, 2012 1 次提交
-
-
由 Steve Klabnik 提交于
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. Closes #1436 Closes #2084 Closes #3807
-
- 16 6月, 2012 1 次提交
-
-
由 Jon Leighton 提交于
Get rid of ActiveModel::Configuration, make better use of ActiveSupport::Concern + class_attribute, etc.
-
- 10 6月, 2012 1 次提交
-
-
由 Andrew White 提交于
There are two possible scenarios where the @mass_assignment_options instance variable can become corrupted: 1. If the assign_attributes doesn't complete correctly, then subsequent calls to a nested attribute assignment method will use whatever options were passed to the previous assign_attributes call. 2. With nested assign_attributes calls, the inner call will overwrite the current options. This will only affect nested attributes as the attribute hash is sanitized before any methods are called. To fix this we save the current options in a local variable and then restore these options in an ensure block.
-
- 30 5月, 2012 1 次提交
-
-
由 kennyj 提交于
-
- 27 5月, 2012 1 次提交
-
-
由 Francesco Rodriguez 提交于
-
- 18 5月, 2012 1 次提交
-
-
由 Peter Suschlik 提交于
-
- 17 5月, 2012 1 次提交
-
-
由 Mark Rushakoff 提交于
-
- 15 5月, 2012 3 次提交
-
-
由 Peter Suschlik 提交于
-
由 Carlos Antonio da Silva 提交于
Introduced in 7ecfe3d3
-
由 Oscar Del Ben 提交于
-
- 12 5月, 2012 4 次提交
-
-
由 Vijay Dev 提交于
-
由 Vijay Dev 提交于
-
由 Vijay Dev 提交于
-
由 Erich Menge 提交于
Add #nodoc to initialize_dup and use :method: to document the #dup method. Relates to issue #6235
-
- 07 5月, 2012 1 次提交
-
-
由 Piotr Sarnacki 提交于
-
- 05 5月, 2012 1 次提交
-
-
由 Piotr Sarnacki 提交于
-
- 03 4月, 2012 1 次提交
-
-
由 Benedikt Deicke 提交于
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'"
-
- 30 3月, 2012 1 次提交
-
-
由 Guillermo Iguaran 提交于
-
- 15 3月, 2012 1 次提交
-
-
由 Bogdan Gusiev 提交于
-
- 14 3月, 2012 1 次提交
-
-
由 kennyj 提交于
-
- 04 3月, 2012 1 次提交
-
-
由 Carlos Antonio da Silva 提交于
This apparently fix the warning related to @new_record variable not being initialized in AR's test suit, when an association is built and the object is marshalled/loaded. See these tests in AR's base_test.rb: test_marshalling_with_associations test_marshalling_new_record_round_trip_with_associations Closes #3720.
-
- 14 2月, 2012 1 次提交
-
-
由 Akira Matsuda 提交于
-
- 08 2月, 2012 4 次提交
-
-
由 Jon Leighton 提交于
-
由 Aaron Patterson 提交于
-
由 Aaron Patterson 提交于
-
由 Aaron Patterson 提交于
copy the columns hash to the active record instances, typecast using columns looked up on the instance
-
- 07 2月, 2012 1 次提交
-
-
由 Josef Šimánek 提交于
-
- 29 1月, 2012 1 次提交
-
-
由 Manoj 提交于
-
- 26 1月, 2012 1 次提交
-
-
由 Aaron Patterson 提交于
another value has been specified).
-
- 21 1月, 2012 2 次提交
-
-
由 Akira Matsuda 提交于
-
由 Jon Leighton 提交于
From 2c667f69. Thanks @pwnall for the heads-up.
-
- 20 1月, 2012 1 次提交
-
-
由 Aaron Patterson 提交于
-
- 12 1月, 2012 1 次提交
-
-
由 Bogdan Gusiev 提交于
-
- 07 1月, 2012 1 次提交
-
-
由 Bogdan Gusiev 提交于
-
- 05 1月, 2012 2 次提交
-
-
由 Rafael Mendonça França 提交于
-
由 Rafael Mendonça França 提交于
-
- 29 12月, 2011 3 次提交
-
-
由 Jon Leighton 提交于
-
由 Jon Leighton 提交于
This is the 'top level' connection, inherited by any models that include ActiveRecord::Model or inherit from ActiveRecord::Base.
-
由 Jon Leighton 提交于
The problem: We need to be able to specify configuration in a way that can be inherited to models that include ActiveRecord::Model. So it is no longer sufficient to put 'top level' config on ActiveRecord::Base, but we do want configuration specified on ActiveRecord::Base and descendants to continue to work. So we need something like class_attribute that can be defined on a module but that is inherited when ActiveRecord::Model is included. The solution: added ActiveModel::Configuration module which provides a config_attribute macro. It's a bit specific hence I am not putting this in Active Support or making it a 'public API' at present.
-
- 24 12月, 2011 1 次提交
-
-
由 Jon Leighton 提交于
-