aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/models/customer.rb
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Deprecating composed_of in ActiveRecord"Rafael Mendonça França2012-08-011-6/+4
| | | | This reverts commit 44b313bc4e3762da64dde7894548f81c595147de.
* Deprecating composed_of in ActiveRecordSteve Klabnik2012-06-181-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* send() will raise an ArgumentError, so we should leverage rubyAaron Patterson2011-01-071-1/+1
|
* Added :constructor and :converter options to composed_of and deprecated the ↵Rob Anderton2008-09-101-1/+19
| | | | | | conversion block Signed-off-by: Michael Koziarski <michael@koziarski.com>
* move assets and modelsJeremy Kemper2008-01-181-0/+55
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8657 5ecf4fe2-1ee6-0310-87b1-e25e094e27de