Refactor: extract methods to a module and class helper, dollarized_attribute
This commit is contained in:
1 parent
83e3023d85
commit
56a38fbd93
5 files changed
+31
-31
No files matched your search
@@ -7,12 +7,6 @@ class OverheadBudget < ActiveRecord::Base
|
||||
# Validations
|
||||
|
||||
# Accessors
|
||||
|
||||
def budget=(v)
|
||||
if v.is_a? String
|
||||
write_attribute(:budget, v.gsub(/[$ ,]/, ''))
|
||||
else
|
||||
write_attribute(:budget, v)
|
||||
end
|
||||
end
|
||||
include DollarizedAttribute
|
||||
dollarized_attribute :budget
|
||||
end
|
||||
Reference in new issue
Block a user