Skip to content

Commit

Permalink
generator migration: fix method name
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Mar 7, 2017
1 parent 65d37e0 commit b711e0b
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 21 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
class <%= migration_class_name %> < GroongaClientModel::Migration
def up
config_delete "<%= @config_key %>"
delete_config "<%= @config_key %>"
end
def down
# config_set "<%= @config_key %>", "old value"
# set_config "<%= @config_key %>", "old value"
end
end
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
class <%= migration_class_name %> < GroongaClientModel::Migration
def up
config_set "<%= @config_key %>", "<%= @config_value %>"
set_config "<%= @config_key %>", "<%= @config_value %>"
end
def down
# config_set "<%= @config_key %>", "old value"
# config_delete "<%= @config_key %>"
# set_config "<%= @config_key %>", "old value"
# delete_config "<%= @config_key %>"
end
end
16 changes: 8 additions & 8 deletions test/apps/rails4/test/generators/migration_generator_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@ def change
assert_migration("db/groonga/migrate/set_config_alias_column.rb", <<-MIGRATION)
class SetConfigAliasColumn < GroongaClientModel::Migration
def up
config_set "alias.column", "new value"
set_config "alias.column", "new value"
end
def down
# config_set "alias.column", "old value"
# config_delete "alias.column"
# set_config "alias.column", "old value"
# delete_config "alias.column"
end
end
MIGRATION
Expand All @@ -75,12 +75,12 @@ def down
assert_migration("db/groonga/migrate/set_config_alias_column.rb", <<-MIGRATION)
class SetConfigAliasColumn < GroongaClientModel::Migration
def up
config_set "alias.column", "aliases.real_name"
set_config "alias.column", "aliases.real_name"
end
def down
# config_set "alias.column", "old value"
# config_delete "alias.column"
# set_config "alias.column", "old value"
# delete_config "alias.column"
end
end
MIGRATION
Expand All @@ -91,11 +91,11 @@ def down
assert_migration("db/groonga/migrate/delete_config_alias_column.rb", <<-MIGRATION)
class DeleteConfigAliasColumn < GroongaClientModel::Migration
def up
config_delete "alias.column"
delete_config "alias.column"
end
def down
# config_set "alias.column", "old value"
# set_config "alias.column", "old value"
end
end
MIGRATION
Expand Down
16 changes: 8 additions & 8 deletions test/apps/rails5/test/generators/migration_generator_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,12 +59,12 @@ def change
assert_migration("db/groonga/migrate/set_config_alias_column.rb", <<-MIGRATION)
class SetConfigAliasColumn < GroongaClientModel::Migration
def up
config_set "alias.column", "new value"
set_config "alias.column", "new value"
end
def down
# config_set "alias.column", "old value"
# config_delete "alias.column"
# set_config "alias.column", "old value"
# delete_config "alias.column"
end
end
MIGRATION
Expand All @@ -75,12 +75,12 @@ def down
assert_migration("db/groonga/migrate/set_config_alias_column.rb", <<-MIGRATION)
class SetConfigAliasColumn < GroongaClientModel::Migration
def up
config_set "alias.column", "aliases.real_name"
set_config "alias.column", "aliases.real_name"
end
def down
# config_set "alias.column", "old value"
# config_delete "alias.column"
# set_config "alias.column", "old value"
# delete_config "alias.column"
end
end
MIGRATION
Expand All @@ -91,11 +91,11 @@ def down
assert_migration("db/groonga/migrate/delete_config_alias_column.rb", <<-MIGRATION)
class DeleteConfigAliasColumn < GroongaClientModel::Migration
def up
config_delete "alias.column"
delete_config "alias.column"
end
def down
# config_set "alias.column", "old value"
# set_config "alias.column", "old value"
end
end
MIGRATION
Expand Down

0 comments on commit b711e0b

Please sign in to comment.