Switch branches/tags
Commits on Jul 26, 2010
  1. rake db:copy_migrations task, which copies railties migrations into a…

    drogus committed Jul 26, 2010
    …pplication's db/migrate directory
  2. Implemented ActiveRecord::Migrations#copy based on James Adam's idea

    drogus committed Jul 26, 2010
    ActiveRecord::Migration#copy allows to copy migrations from one place
    to another, changing migrations versions and adding scope to filename.
    For example:
            :blog_engine => "vendor/gems/blog/db/migrate")
    will copy all migrations from vendor/gems/blog/db/migrate to db/migrate
    with such format:
    Versions of copied migrations will be reversioned to be appended after
    migrations that already exists in db/migrate
Commits on Jul 25, 2010
  1. to_param shoul return a string

    drogus committed Jul 24, 2010
  2. Add mounted_helpers to routes

    drogus committed Jul 18, 2010
    mounted_helpers are a bit similar to url_helpers. They're automatically
    included in controllers for Rails.application and each of mounted
    Engines. Mounted helper allows to call url_for and named helpers for
    given application.
    Given Blog::Engine mounted as blog_engine, there are 2 helpers defined:
    app and blog_engine. You can call routes for app and engine using those
    app.url_for(:controller => "foo")
  3. Routes refactoring:

    drogus committed Jul 14, 2010
    * added more tests for prefix generation
    * fixed bug with generating host for both prefix and url
    * refactored url_for method
    * organized tests for prefix generation
  4. Extended url_for to handle specifying which router should be used.

    drogus committed Jul 13, 2010
    A few examples:
    url_for Blog::Engine, :posts_path
    url_for Blog::Engine, @post
    url_for Blog::Engine, :action => "main", :controller => "index"
  5. Refactored tests for prefix generation and added test for url generat…

    drogus committed Jul 8, 2010
    …ion in regular class with default_url_options[:script_name] set
  6. New way of generating urls for Application from Engine.

    drogus committed Jul 8, 2010
    It's based specifying application's script_name with:
    Rails.application.default_url_options = {:script_name => "/foo"}
    default_url_options method is delegated to routes. If router
    used to generate url differs from the router passed via env
    it always overwrites :script_name with this value.
  7. Fix url generation for mounted Engine

    drogus committed Jul 7, 2010
    I added integration tests for generating urls in Engine and application
    and tweaked Engines to fully cooparate with new router's behavior:
    * Rails.application now sets ORIGINAL_SCRIPT_NAME
    * Rails.application also sets its routes as env['action_dispatch.parent_routes']
    * Engine implements responds_to? class method to respond to all the
      instance methods, like #routes
  8. Allow to generate Application routes inside Engine

    drogus committed Jul 7, 2010
    This requires knowledge about original SCRIPT_NAME and
    the parent router. It should be pass through the env
    as ORIGIAL_SCRIPT_NAME and action_dispatch.parent_routes
  9. Pass routes via env['action_dispatch.routes'], it's needed by routes …

    drogus committed Jul 1, 2010
    …to determine if it should generate prefix for mounted apps
  10. Use env['action_dispatch.routes'] to determine if we should generate …

    drogus committed Jul 1, 2010
    …prefix or not.
    This technique is here to allow using routes from Engine in Application
    and vice versa. When using Engine routes inside Application it should
    generate prefix based on mount point. When using Engine routes inside
    Engine it should use env['SCRIPT_NAME']. In any other case it should
    generate prefix as env should not be even available.
  11. Move singleton pattern to Railtie and remove Engine::Configurable and…

    drogus committed Jul 19, 2010
    … Application::Configurable in favor of unified Railtie::Configurable
  12. We don't need to add railties initlaizers in Application as there is …

    drogus committed Jul 8, 2010
    …already done in Engine and it's called with super
  13. Removed ActionDispatch::Static, but left empty MiddlewareStack to uni…

    drogus committed Jul 8, 2010
    …fy app method between Engine and Application