Sha256: c7ace989421457988cd89484fff77d816c2830001a29d56775df113dd87e4590

Contents?: true

Size: 571 Bytes

Versions: 1

Compression:

Stored size: 571 Bytes

Contents

module EasyRailsMoney
  module ActiveRecord
    module Migration
      module SchemaStatements
        def add_money(table_name, *columns)
          columns.each do |name|
            add_column table_name, "#{name}_money",    :integer
            add_column table_name, "#{name}_currency", :string
          end
        end

        def remove_money(table_name, *columns)
          columns.each do |name|
            remove_column table_name, "#{name}_money"
            remove_column table_name, "#{name}_currency"
          end
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
easy_rails_money-0.0.2 lib/easy_rails_money/active_record/migration/schema_statements.rb