diff options
author | Arthur Nogueira Neves <github@arthurnn.com> | 2015-10-13 21:50:27 -0400 |
---|---|---|
committer | Arthur Nogueira Neves <github@arthurnn.com> | 2015-10-13 21:50:27 -0400 |
commit | 7776bde55acf53a623e6c772c57e3bb662a196bd (patch) | |
tree | 34a31561348ec08a00fbc73945e82ec0c6dc632f /activerecord/lib | |
parent | 2145701cdd68a1aaf4d5777cbf895cb10df5c40a (diff) | |
parent | 7cd6a28c783ce8464bb2061f7cbc4989b6985ad8 (diff) | |
download | rails-7776bde55acf53a623e6c772c57e3bb662a196bd.tar.gz rails-7776bde55acf53a623e6c772c57e3bb662a196bd.tar.bz2 rails-7776bde55acf53a623e6c772c57e3bb662a196bd.zip |
Merge pull request #21635 from sideshowcoder/ar_type_docs_fix
Documentation ActiveRecord Attributes API code fix
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/attributes.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/attributes.rb b/activerecord/lib/active_record/attributes.rb index a573f76a8e..f244f37e40 100644 --- a/activerecord/lib/active_record/attributes.rb +++ b/activerecord/lib/active_record/attributes.rb @@ -119,7 +119,7 @@ module ActiveRecord # # class MoneyType < ActiveRecord::Type::Integer # def cast(value) - # if value.include?('$') + # if !value.kind_of(Numeric) && value.include?('$') # price_in_dollars = value.gsub(/\$/, '').to_f # super(price_in_dollars * 100) # else |