https://github.com/sixarm/sixarm_ruby_migration_helper_extensions
SixArm.com » Ruby » Migration Helper extensions and extras
https://github.com/sixarm/sixarm_ruby_migration_helper_extensions
extension gem migration rails ruby
Last synced: about 2 months ago
JSON representation
SixArm.com » Ruby » Migration Helper extensions and extras
- Host: GitHub
- URL: https://github.com/sixarm/sixarm_ruby_migration_helper_extensions
- Owner: SixArm
- License: other
- Created: 2010-10-18T05:09:31.000Z (over 15 years ago)
- Default Branch: main
- Last Pushed: 2023-09-15T19:28:29.000Z (almost 3 years ago)
- Last Synced: 2025-02-06T00:24:54.690Z (over 1 year ago)
- Topics: extension, gem, migration, rails, ruby
- Language: Ruby
- Homepage: http://sixarm.com
- Size: 295 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGES.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
- Codeowners: CODEOWNERS
Awesome Lists containing this project
README
# SixArm.com → Ruby →
Migration Helper Extensions for Ruby On Rails ActiveRecord
[](http://badge.fury.io/rb/sixarm_ruby_migration_helper_extensions)
[](https://travis-ci.org/SixArm/sixarm_ruby_migration_helper_extensions)
[](https://codeclimate.com/github/SixArm/sixarm_ruby_migration_helper_extensions/maintainability)
* Git:
* Doc:
* Gem:
* Contact: Joel Parker Henderson,
* Project: [changes](CHANGES.md), [license](LICENSE.md), [contributing](CONTRIBUTING.md).
## Introduction
Ruby On Rails ActiveRecord MigrationHelper extensions
For docs go to
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