Sha256: b09ad0e69e595790f73204ab7325b0d69b9133b2ecfd113cfaec77a44360ca66
Contents?: true
Size: 743 Bytes
Versions: 10
Compression:
Stored size: 743 Bytes
Contents
module MoneyRails module ActiveRecord module MigrationExtensions module SchemaStatements def add_money(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_money(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
10 entries across 10 versions & 1 rubygems