Skip to content

Commit

Permalink
Fix the migration class name
Browse files Browse the repository at this point in the history
Due to Active Support auto loading feature, the migration class
shouldn't be name-spaced under the `ActiveStorage` constant, otherwise,
running the migrations would throw an error.
  • Loading branch information
robin850 committed Jul 6, 2017
1 parent a2e864f commit fb88ff7
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lib/active_storage/migration.rb
@@ -1,4 +1,4 @@
class ActiveStorage::CreateTables < ActiveRecord::Migration[5.1]
class ActiveStorageCreateTables < ActiveRecord::Migration[5.1]
def change
create_table :active_storage_blobs do |t|
t.string :key
Expand Down
2 changes: 1 addition & 1 deletion test/database/create_users_migration.rb
@@ -1,4 +1,4 @@
class ActiveStorage::CreateUsers < ActiveRecord::Migration[5.1]
class ActiveStorageCreateUsers < ActiveRecord::Migration[5.1]
def change
create_table :users do |t|
t.string :name
Expand Down
4 changes: 2 additions & 2 deletions test/database/setup.rb
Expand Up @@ -2,5 +2,5 @@
require_relative "create_users_migration"

ActiveRecord::Base.establish_connection(adapter: 'sqlite3', database: ':memory:')
ActiveStorage::CreateTables.migrate(:up)
ActiveStorage::CreateUsers.migrate(:up)
ActiveStorageCreateTables.migrate(:up)
ActiveStorageCreateUsers.migrate(:up)

0 comments on commit fb88ff7

Please sign in to comment.