Sha256: e71afbfacd60e1fa4616fbcdbe53b27e6ba6b8d82016eefe6c8248cae0550fd9

Contents?: true

Size: 507 Bytes

Versions: 18

Compression:

Stored size: 507 Bytes

Contents

module Weighable
  module ActiveRecord
    module MigrationExtensions
      module Table
        def weighable(column)
          column "#{column}_value", :decimal, precision: 30, scale: 15
          column "#{column}_unit", :integer, limit: 1
          column "#{column}_display_unit", :integer, limit: 1
        end

        def remove_weighable(column)
          remove "#{column}_value"
          remove "#{column}_unit"
          remove "#{column}_display_unit"
        end
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
weighable-1.5.0 lib/weighable/active_record/migration_extensions/table.rb
weighable-1.4.0 lib/weighable/active_record/migration_extensions/table.rb
weighable-1.3.0 lib/weighable/active_record/migration_extensions/table.rb
weighable-1.2.1 lib/weighable/active_record/migration_extensions/table.rb
weighable-1.2.0 lib/weighable/active_record/migration_extensions/table.rb
weighable-1.1.0 lib/weighable/active_record/migration_extensions/table.rb
weighable-1.0.1 lib/weighable/active_record/migration_extensions/table.rb
weighable-1.0.0 lib/weighable/active_record/migration_extensions/table.rb
weighable-0.10.1 lib/weighable/active_record/migration_extensions/table.rb
weighable-0.10.0 lib/weighable/active_record/migration_extensions/table.rb
weighable-0.9.0 lib/weighable/active_record/migration_extensions/table.rb
weighable-0.8.1 lib/weighable/active_record/migration_extensions/table.rb
weighable-0.8.0 lib/weighable/active_record/migration_extensions/table.rb
weighable-0.7.1 lib/weighable/active_record/migration_extensions/table.rb
weighable-0.7.0 lib/weighable/active_record/migration_extensions/table.rb
weighable-0.6.1 lib/weighable/active_record/migration_extensions/table.rb
weighable-0.6.0 lib/weighable/active_record/migration_extensions/table.rb
weighable-0.5.1 lib/weighable/active_record/migration_extensions/table.rb