forgeplus/app/models/concerns/number_display_helper.rb

13 lines
306 B
Ruby
Raw Normal View History

2020-03-09 00:40:16 +08:00
module NumberDisplayHelper
extend ActiveSupport::Concern
module ClassMethods
def number_display_methods(*columns, **opts)
columns.each do |column|
define_method "display_#{column}" do
number_to_currency(column.to_f, opts)
end
end
end
end
end