Commit message (Collapse) | Author | Age | Files | Lines | |
---|---|---|---|---|---|
* | Removing composed_of from ActiveRecord. | Steve Klabnik | 2012-06-18 | 1 | -2/+2 |
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 | ||||
* | Fix deprecation warnings when using ↵ | Jon Leighton | 2012-06-15 | 1 | -3/+8 |
| | | | | config.active_record.mass_assignment_sanitizer= | ||||
* | Fix observers with AR::Model | Jon Leighton | 2012-06-15 | 1 | -0/+1 |
| | |||||
* | Fix config.active_record.whitelist_attributes with AR::Model | Jon Leighton | 2012-06-15 | 1 | -0/+13 |
| | |||||
* | Merge pull request #6676 from aurelian/master | Rafael Mendonça França | 2012-06-12 | 1 | -1/+1 |
|\ | | | | | Don't assign the attributes if the list is empty | ||||
| * | Don't assign the attributes if the list is empty. | Aurelian Oancea | 2012-06-08 | 1 | -1/+1 |
| | | |||||
* | | Ensure that mass assignment options are preserved | Andrew White | 2012-06-10 | 1 | -1/+3 |
|/ | | | | | | | | | | | | | | | | 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. | ||||
* | Split out most of the AR::Base code into separate modules :cake: | Jon Leighton | 2011-12-15 | 1 | -0/+221 |