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.

Allow AR::Schema's migrations_path to be overwritten by subclasses

#3671

Extracts the hard-coded migrations path so it can be customized by subclasses. This is useful when you have a separate schema and migrations using a different connection. Otherwise, the default path of 'db/migrate' causes assume_migrated_up_to make the wrong assumption about prior migrations.

class SignalId::Schema < ActiveRecord::Schema
  def self.migrations_path
    SignalId.root + '/db/migrate'
  end
end

Ideally, we'd have something like a SchemaLoader that took a schema and a migration path. Since Schema is a Migration, Migrator could reasonably assume this responsibility as well. But that would be incompatible with normal usage which is simiply load 'schema.rb'.

Patch applies to master and 2-3-stable.

Reported by Jeffrey Hardy · January 8th, 2010 @ 09:05 PM

State: committed
Milestone: none
Assigned to: nobody
Importance: none