Browse files

Strengthen documantation on engine's migrations and seed data

Signed-off-by: José Valim <jose.valim@gmail.com>
  • Loading branch information...
1 parent d475de7 commit dfac9b1404d78d1abb793431bb034a2cc78ce270 @drogus drogus committed with josevalim Sep 19, 2010
Showing with 15 additions and 0 deletions.
  1. +15 −0 railties/lib/rails/engine.rb
View
15 railties/lib/rails/engine.rb
@@ -257,6 +257,21 @@ module Rails
#
# This code will use my_engine.user_path(@user) to generate proper route.
#
+ # == Migrations & seed data
+ #
+ # Engines can have their own migrations. Default path for migrations is exactly the same
+ # as in application: db/migrate
+ #
+ # To use engine's migrations in application you can use rake task, which copies them to
+ # application's dir:
+ #
+ # rake railties:copy_migrations
+ #
+ # If your engine has migrations, you may also want to prepare data for the database in
+ # seeds.rb file. You can load that data using load_seed method, e.g.
+ #
+ # MyEngine::Engine.load_seed
+ #
class Engine < Railtie
autoload :Configurable, "rails/engine/configurable"
autoload :Configuration, "rails/engine/configuration"

0 comments on commit dfac9b1

Please sign in to comment.