Sha256: 5feee61ebd2d942234c8e2ca44d724881b617e3c7d83d415c27b73bd368422c3

Contents?: true

Size: 673 Bytes

Versions: 10

Compression:

Stored size: 673 Bytes

Contents

module MoneyRails
  module ActiveRecord
    module MigrationExtensions
      module Table
        def money(accessor, options={})
          [:amount, :currency].each do |attribute|
            column_present, _, *opts = OptionsExtractor.extract attribute, :no_table, accessor, options
            column *opts if column_present
          end
        end

        def remove_money(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
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
money-rails-1.3.0 lib/money-rails/active_record/migration_extensions/table.rb
money-rails-1.2.0 lib/money-rails/active_record/migration_extensions/table.rb
money-rails-1.1.0 lib/money-rails/active_record/migration_extensions/table.rb
money-rails-1.0.0 lib/money-rails/active_record/migration_extensions/table.rb
money-rails-0.12.0 lib/money-rails/active_record/migration_extensions/table.rb
money-rails-0.11.0 lib/money-rails/active_record/migration_extensions/table.rb
money-rails-0.10.0 lib/money-rails/active_record/migration_extensions/table.rb
money-rails-0.9.0 lib/money-rails/active_record/migration_extensions/table.rb
money-rails-0.8.1 lib/money-rails/active_record/migration_extensions/table.rb
money-rails-0.7.1 lib/money-rails/active_record/migration_extensions/table.rb