Skip to content

Instantly share code, notes, and snippets.

@bansalakhil
Created August 20, 2012 06:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bansalakhil/3401574 to your computer and use it in GitHub Desktop.
Save bansalakhil/3401574 to your computer and use it in GitHub Desktop.
Edge Rails accepts a polymorphic modifier for references in migration generators
Allow scaffold/model/migration generators to accept a polymorphic modifier for references/belongs_to, for instance
rails g model Product supplier:references{polymorphic}
will generate the model with belongs_to :supplier, polymorphic: true association and appropriate migration.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment