diff options
author | Jeffrey Hardy <jeff@37signals.com> | 2010-01-08 12:38:32 -0500 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2010-01-08 13:08:23 -0800 |
commit | 652d1c19ea077fb0af70379181bd4629e08944b6 (patch) | |
tree | 9a5ca55b0dc45a9654dd6b4bc485120f515245f8 /activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb | |
parent | 802b08da0075bf6426c723957447ed85dc849bba (diff) | |
download | rails-652d1c19ea077fb0af70379181bd4629e08944b6.tar.gz rails-652d1c19ea077fb0af70379181bd4629e08944b6.tar.bz2 rails-652d1c19ea077fb0af70379181bd4629e08944b6.zip |
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>
Diffstat (limited to 'activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb')
-rw-r--r-- | activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb b/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb index e731bc84f0..86ba7d72c3 100644 --- a/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb @@ -344,12 +344,12 @@ module ActiveRecord end end - def assume_migrated_upto_version(version) + def assume_migrated_upto_version(version, migrations_path = ActiveRecord::Migrator.migrations_path) version = version.to_i sm_table = quote_table_name(ActiveRecord::Migrator.schema_migrations_table_name) migrated = select_values("SELECT version FROM #{sm_table}").map(&:to_i) - versions = Dir['db/migrate/[0-9]*_*.rb'].map do |filename| + versions = Dir["#{migrations_path}/[0-9]*_*.rb"].map do |filename| filename.split('/').last.split('_').first.to_i end |