Class: RuboCop::Cop::Captive::Rails::NoFloatPriceColumns
- Inherits:
-
Base
- Object
- Base
- RuboCop::Cop::Captive::Rails::NoFloatPriceColumns
- Defined in:
- lib/rubocop/cop/captive/rails/no_float_price_columns.rb
Constant Summary collapse
- MSG =
"Avoid using `float` type for price columns. \ Use `decimal, precision: 10, scale: 2` instead."
Instance Method Summary collapse
Instance Method Details
#on_send(node) ⇒ Object
15 16 17 18 19 |
# File 'lib/rubocop/cop/captive/rails/no_float_price_columns.rb', line 15 def on_send(node) add_column_call?(node) do |column| add_offense(column, message: MSG) end end |