module MoneyRails::ActiveRecord::MigrationExtensions::Table
Public Instance Methods
monetize(accessor, options={})
click to toggle source
# File lib/money-rails/active_record/migration_extensions/table_pg_rails4.rb, line 5 def monetize(accessor, options={}) [:amount, :currency].each do |attribute| column_present, _, *opts = OptionsExtractor.extract attribute, :no_table, accessor, options constraints = opts.pop column(*opts, **constraints) if column_present end end
money(accessor, options={})
click to toggle source
# File lib/money-rails/active_record/migration_extensions/table.rb, line 5 def money(accessor, options={}) monetize(accessor, options) end
remove_monetize(accessor, options={})
click to toggle source
# File lib/money-rails/active_record/migration_extensions/table_pg_rails4.rb, line 13 def remove_monetize(accessor, options={}) [:amount, :currency].each do |attribute| column_present, _, column_name, _, _ = OptionsExtractor.extract attribute, :no_table, accessor, options remove column_name if column_present end end
remove_money(accessor, options={})
click to toggle source
# File lib/money-rails/active_record/migration_extensions/table.rb, line 9 def remove_money(accessor, options={}) remove_monetize(accessor, options) end