diff --git a/db/migrate/20150525081931_remove_duplicate_tokens.rb b/db/migrate/20150525081931_remove_duplicate_tokens.rb index a43edd20fc8..29efabcfee1 100644 --- a/db/migrate/20150525081931_remove_duplicate_tokens.rb +++ b/db/migrate/20150525081931_remove_duplicate_tokens.rb @@ -1,15 +1,15 @@ class RemoveDuplicateTokens < ActiveRecord::Migration[4.2] def up - remove_foreign_key :tokens, :column => :host_id if foreign_key_exists?(:tokens, { :name => "tokens_host_id_fk" }) + remove_foreign_key :tokens, :column => :host_id if foreign_key_exists?(:tokens, name: "tokens_host_id_fk") remove_index :tokens, :host_id if index_exists? :tokens, :host_id add_index :tokens, :host_id, :unique => true - add_foreign_key :tokens, :hosts, :name => "tokens_host_id_fk" unless foreign_key_exists?(:tokens, { :name => "tokens_host_id_fk" }) + add_foreign_key :tokens, :hosts, :name => "tokens_host_id_fk" unless foreign_key_exists?(:tokens, name: "tokens_host_id_fk") end def down - remove_foreign_key :tokens, :column => :host_id if foreign_key_exists?(:tokens, { :name => "tokens_host_id_fk" }) + remove_foreign_key :tokens, :column => :host_id if foreign_key_exists?(:tokens, name: "tokens_host_id_fk") remove_index :tokens, :host_id if index_exists? :tokens, :host_id add_index :tokens, :host_id - add_foreign_key :tokens, :hosts, :name => "tokens_host_id_fk" unless foreign_key_exists?(:tokens, { :name => "tokens_host_id_fk" }) + add_foreign_key :tokens, :hosts, :name => "tokens_host_id_fk" unless foreign_key_exists?(:tokens, name: "tokens_host_id_fk") end end diff --git a/db/migrate/20180613100703_add_type_to_token.rb b/db/migrate/20180613100703_add_type_to_token.rb index 1f1e7901c63..953ea271d0e 100644 --- a/db/migrate/20180613100703_add_type_to_token.rb +++ b/db/migrate/20180613100703_add_type_to_token.rb @@ -1,9 +1,9 @@ class AddTypeToToken < ActiveRecord::Migration[5.1] def up - remove_foreign_key :tokens, :column => :host_id if foreign_key_exists?(:tokens, { :name => "tokens_host_id_fk" }) + remove_foreign_key :tokens, :column => :host_id if foreign_key_exists?(:tokens, name: "tokens_host_id_fk") remove_index :tokens, :host_id if index_exists? :tokens, :host_id # was unique add_index :tokens, :host_id - add_foreign_key :tokens, :hosts, :name => "tokens_host_id_fk" unless foreign_key_exists?(:tokens, { :name => "tokens_host_id_fk" }) + add_foreign_key :tokens, :hosts, :name => "tokens_host_id_fk" unless foreign_key_exists?(:tokens, name: "tokens_host_id_fk") add_column :tokens, :type, :string, default: 'Token::Build', null: false, index: true change_column :tokens, :value, :text end @@ -11,9 +11,9 @@ def up def down change_column :tokens, :value, :string, limit: 255 remove_column :tokens, :type - remove_foreign_key :tokens, :column => :host_id if foreign_key_exists?(:tokens, { :name => "tokens_host_id_fk" }) + remove_foreign_key :tokens, :column => :host_id if foreign_key_exists?(:tokens, name: "tokens_host_id_fk") remove_index :tokens, :host_id if index_exists? :tokens, :host_id add_index :tokens, :host_id, :unique => true - add_foreign_key :tokens, :hosts, :name => "tokens_host_id_fk" unless foreign_key_exists?(:tokens, { :name => "tokens_host_id_fk" }) + add_foreign_key :tokens, :hosts, :name => "tokens_host_id_fk" unless foreign_key_exists?(:tokens, name: "tokens_host_id_fk") end end diff --git a/test/controllers/home_controller_test.rb b/test/controllers/home_controller_test.rb index 75ce9c9d209..d61724e93e8 100644 --- a/test/controllers/home_controller_test.rb +++ b/test/controllers/home_controller_test.rb @@ -2,7 +2,7 @@ class HomeControllerTest < ActionController::TestCase test "should get status without an error" do - get :status, {:format => "json"} + get :status, :format => "json" assert_response :success end end diff --git a/test/unit/setting_manager_test.rb b/test/unit/setting_manager_test.rb index d6024bb9fd1..6610acd44d5 100644 --- a/test/unit/setting_manager_test.rb +++ b/test/unit/setting_manager_test.rb @@ -118,7 +118,7 @@ class SettingManagerTest < ActiveSupport::TestCase default: 'bar@example.com', description: 'This is nicely described foo setting', full_name: 'Foo setting') - validates(:validfoo, email: true) + validates(:validfoo, { email: true }) end end Foreman::SettingManager.validations.setup!