Sha256: cdd95bf63f7ba3af640547b74273db1439fb99d7be94cd094fabe0aba472eeb2
Contents?: true
Size: 750 Bytes
Versions: 13
Compression:
Stored size: 750 Bytes
Contents
module MoneyRails module ActiveRecord module MigrationExtensions module SchemaStatements def add_monetize(table_name, accessor, options={}) [:amount, :currency].each do |attribute| column_present, *opts = OptionsExtractor.extract attribute, table_name, accessor, options add_column(*opts) if column_present end end def remove_monetize(table_name, accessor, options={}) [:amount, :currency].each do |attribute| column_present, table_name, column_name, _, _ = OptionsExtractor.extract attribute, table_name, accessor, options remove_column table_name, column_name if column_present end end end end end end
Version data entries
13 entries across 13 versions & 1 rubygems