Skip to content

Instantly share code, notes, and snippets.

@jnicklas
Created March 30, 2009 21:14
Show Gist options
  • Save jnicklas/87891 to your computer and use it in GitHub Desktop.
Save jnicklas/87891 to your computer and use it in GitHub Desktop.
# Consistent API so we can change the underpinnings without breakage
# Everything done inside the block will adopt :activerecord as trait
Rails.generator(:model).add(:activerecord) do
# this will be handled as a binary file
action 'file.png'
# as a template
action 'some_ruby_file.rb'
# as a directory
action 'some/directory'
# invoke! is a stupid name, call it what it does instead...
generate :migration
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment