This project is archived and is in readonly mode.
Allow AR::Schema's migrations_path to be overwritten by subclasses
Reported by Jeffrey Hardy | January 8th, 2010 @ 09:05 PM
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.
Comments and changes to this ticket
-
Repository January 8th, 2010 @ 09:35 PM
- State changed from new to committed
(from [6e9b01fddb5a461b4e010f07eda7f758c607e677]) Allow AR::Schema's migrations_path to be overwritten by subclasses. Defaults to 'db/migrate'
[#3671 state:committed]
Signed-off-by: Jeremy Kemper jeremy@bitsweat.net
http://github.com/rails/rails/commit/6e9b01fddb5a461b4e010f07eda7f7... -
Repository January 8th, 2010 @ 09:35 PM
(from [652d1c19ea077fb0af70379181bd4629e08944b6]) Allow AR::Schema's migrations_path to be overwritten by subclasses. Defaults to 'db/migrate'
[#3671 state:committed]
Signed-off-by: Jeremy Kemper jeremy@bitsweat.net
http://github.com/rails/rails/commit/652d1c19ea077fb0af70379181bd46...
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>
People watching this ticket
Attachments
Referenced by
- 3671 Allow AR::Schema's migrations_path to be overwritten by subclasses [#3671 state:committed]
- 3671 Allow AR::Schema's migrations_path to be overwritten by subclasses [#3671 state:committed]