Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

split out migration logic in generators

#5389

Currently the ActiveRecord::Generators::Base class inherits from NamedBase. This means that any generator that wants to make use of a method such as migration_template needs to pass in a NAME to the generator. This so far has always fit the current generator usage well, but for others in the future it may be inconvenient.

This simple patch pulls the logic out into a module that another generator could easily include and use to build a non NamedBase subclass that creates a migration.

We could also have ActiveRecord::Generators::Base inherit from Base instead, but I imagine that would lead to a lot of other unnecessary and perhaps complex changes.

Reported by jack dempsey (jackdempsey) · August 17th, 2010 @ 04:03 AM

State: resolved
Milestone: none
Assigned to: José Valim José Valim
Importance: none

Activity

  1. Repository
    Repository
    • State changed from new to resolved

    (from [c25c81e7c9656dee2b5ac9d490784df44e8e23f9]) split out active_record migration logic so others can easily reuse [#5389 state:resolved]

    Signed-off-by: José Valim jose.valim@gmail.com
    http://github.com/rails/rails/commit/c25c81e7c9656dee2b5ac9d490784d...

    September 1st, 2010 @ 09:15 AM

  2. Repository
    Repository

    (from [a79e985923389863cae0f4a98538096e3723e010]) split out active_record migration logic so others can easily reuse [#5389 state:resolved]

    Signed-off-by: José Valim jose.valim@gmail.com
    http://github.com/rails/rails/commit/a79e985923389863cae0f4a9853809...

    September 1st, 2010 @ 09:15 AM

  3. Andrea Campi
    Andrea Campi
    • Tag changed from patch activerecord, enhancement to activerecord, enhancement, patch

    bulk tags cleanup

    October 11th, 2010 @ 07:18 AM