Skip to content
This repository was archived by the owner on Oct 22, 2021. It is now read-only.

janlelis/slim_migrations

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Please note: This project is archived and does not work with recent versions of Rails anymore.

SlimMigrations

Turns

class AddWebsiteToUser < ActiveRecord::Migration
  def self.up
    add_column :users, :website, :string
  end

  def self.down
    remove_column :users, :website
  end
end

into

migration do
  def up
    add_column :users, :website, :string
  end

  def down
    remove_column :users, :website
  end
end

Extras

  • Modifies the rails generator to use the slim syntax

  • Helper task for converting existing migrations: rake slim_migrations:update_syntax

Install

Rails 3.2

# in your Gemfile
gem 'slim_migrations', '~> 3.2.1'

Rails 3.1

# as plugin:
rails plugin install git://github.com/janlelis/slim_migrations.git -r 3.1
# or in your Gemfile:
gem 'slim_migrations', '~> 3.1.1'

Rails 3.0

# as plugin:
rails plugin install git://github.com/janlelis/slim_migrations.git -r 3.0
# or in your Gemfile:
gem 'slim_migrations', '~> 3.0.1'

Rails 2.3

# as plugin:
script/plugin install git://github.com/janlelis/slim_migrations.git -r 2.3
# or in your config/environment.rb
config.gem 'slim_migrations', :version => '~> 2.3.1'

Credits

Blog post: rbjl.janlelis.com/53-three-little-tips-for-slimmer-rails-migrations

Thanks to contributions from: Manuel Meurer

MIT-LICENSE, J-_-L

About

Let's you write slightly slimmer Rails migrations.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages