Module: MoneyRails::ActiveRecord::MigrationExtensions::Table
- Defined in:
- lib/money-rails/active_record/migration_extensions/table.rb
Instance Method Summary collapse
Instance Method Details
#money(accessor, options = {}) ⇒ Object
5 6 7 8 9 10 |
# File 'lib/money-rails/active_record/migration_extensions/table.rb', line 5 def money(accessor, ={}) [:amount, :currency].each do |attribute| column_present, _, *opts = OptionsExtractor.extract attribute, :no_table, accessor, column *opts if column_present end end |
#remove_money(accessor, options = {}) ⇒ Object
12 13 14 15 16 17 |
# File 'lib/money-rails/active_record/migration_extensions/table.rb', line 12 def remove_money(accessor, ={}) [:amount, :currency].each do |attribute| column_present, _, column_name, _, _ = OptionsExtractor.extract attribute, :no_table, accessor, remove column_name if column_present end end |