Skip to content

SixArm/sixarm_ruby_migration_helper_extensions

Repository files navigation

SixArm.com → Ruby →
Migration Helper Extensions for Ruby On Rails ActiveRecord

Gem Version Build Status Code Climate

Introduction

Ruby On Rails ActiveRecord MigrationHelper extensions

For docs go to http://sixarm.com/sixarm_ruby_migration_helper_extensions/doc

Want to help? We're happy to get pull requests.

Install

Gem

To install this gem in your shell or terminal:

gem install sixarm_ruby_migration_helper_extensions

Gemfile

To add this gem to your Gemfile:

gem 'sixarm_ruby_migration_helper_extensions'

Require

To require the gem in your code:

require 'sixarm_ruby_migration_helper_extensions'

Examples

Migration:

require "sixarm_ruby_migration_helper_extensions"
class CreateItems < ActiveRecord::Migration

  def self.up
     create_table 'items' do |t|
       t.timestamps
       t.name
       t.email
       t.phone
       t.height
       t.weight
       t.latitude
       t.longitude
     end
   end

  def self.down
    drop_table 'items'
  end

end

The result is an item class with fields of the various data types:

item = Item.new
item.name = "Statue Of Liberty"
item.email = "liberty@example.com"
item.phone = "+1-212-363-3200"
item.height = 46.50
item.weight = 204116566
item.latitude = 40.68913
item.longitude = -74.0446
item.save

About

SixArm.com » Ruby » Migration Helper extensions and extras

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages