diff options
author | Gabriel Horner <gabriel.horner@gmail.com> | 2011-07-22 18:43:27 -0400 |
---|---|---|
committer | Gabriel Horner <gabriel.horner@gmail.com> | 2011-07-24 00:31:37 -0400 |
commit | 6e3c0a5d9a22a4a08628b3f72a6b4072e0a23405 (patch) | |
tree | 268ebfc61175f3afabeb6a5967887db0c12b87c3 /activerecord/test/models/wholesale_product.rb | |
parent | f956759f8ab656484add2d5bc6e8f6f4add79469 (diff) | |
download | rails-6e3c0a5d9a22a4a08628b3f72a6b4072e0a23405.tar.gz rails-6e3c0a5d9a22a4a08628b3f72a6b4072e0a23405.tar.bz2 rails-6e3c0a5d9a22a4a08628b3f72a6b4072e0a23405.zip |
simplify and be more explicit about create and after_initialize tests
Diffstat (limited to 'activerecord/test/models/wholesale_product.rb')
-rw-r--r-- | activerecord/test/models/wholesale_product.rb | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/activerecord/test/models/wholesale_product.rb b/activerecord/test/models/wholesale_product.rb index e1a1a4c8b1..5c6c15391c 100644 --- a/activerecord/test/models/wholesale_product.rb +++ b/activerecord/test/models/wholesale_product.rb @@ -3,11 +3,7 @@ class WholesaleProduct < ActiveRecord::Base after_initialize :set_prices def set_prices - if msrp.nil? && !wholesale.nil? - self.msrp = 2 * wholesale - elsif !msrp.nil? && wholesale.nil? - self.wholesale = msrp / 2 - end + self.msrp = 2 * wholesale if wholesale end -end
\ No newline at end of file +end |