diff --git a/.travis.yml b/.travis.yml index 6d092549..fb1b2692 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,5 +7,5 @@ rvm: - 2.4.1 env: - - RAILS_VERSION=4.2 - - RAILS_VERSION=5.0 + - RAILS_VERSION=5.0.3 + - RAILS_VERSION=5.1 diff --git a/Gemfile b/Gemfile index 2633371c..de50ff63 100644 --- a/Gemfile +++ b/Gemfile @@ -2,23 +2,8 @@ source 'https://rubygems.org' gemspec -version = ENV['RAILS_VERSION'] || '4.2' -rails = case version -when 'master' - { github: 'rails/rails' } -when '4.0-protected-attributes' - gem 'protected_attributes' - "~> 4.0.0" -when /4\.0|4\.1/ - "~> #{version}.0" -when /4\.2/ - "~> #{version}.0.rc3" -when '3.2' - gem 'strong_parameters' - "~> #{version}.0" -end - -gem 'rails', rails +version = ENV['RAILS_VERSION'] || '5.0.3' +gem 'rails', version case ENV['ORM'] when 'active_record' @@ -36,7 +21,7 @@ platforms :rbx do gem 'rubysl', '~> 2.0' gem 'psych' gem 'racc' - gem 'minitest' + gem 'minitest', '~> 5.10', '!= 5.10.2' gem 'rubinius-developer_tools' end diff --git a/lib/merit/controller_extensions.rb b/lib/merit/controller_extensions.rb index e6249098..c65406b9 100644 --- a/lib/merit/controller_extensions.rb +++ b/lib/merit/controller_extensions.rb @@ -4,11 +4,7 @@ module Merit # 'controller_path#action_name' module ControllerExtensions def self.included(base) - if base.respond_to? :after_action - base.after_action :log_and_process - else - base.after_filter :log_and_process - end + base.after_action :log_and_process end private diff --git a/merit.gemspec b/merit.gemspec index 5df75ca5..35681bdf 100644 --- a/merit.gemspec +++ b/merit.gemspec @@ -12,8 +12,8 @@ Gem::Specification.new do |s| s.required_ruby_version = '>= 1.9.2' - s.add_dependency 'ambry', '~> 1.0.0' - s.add_development_dependency 'rails', '>= 3.2.0' + s.add_dependency 'ambry', '~> 1.0.0' + s.add_development_dependency 'rails', '>= 5.0.0' s.add_development_dependency 'capybara' s.add_development_dependency 'simplecov' s.add_development_dependency 'rubocop' diff --git a/test/dummy/config/environments/test.rb b/test/dummy/config/environments/test.rb index 5e3304ba..85878ac6 100644 --- a/test/dummy/config/environments/test.rb +++ b/test/dummy/config/environments/test.rb @@ -32,5 +32,5 @@ # Print deprecation notices to the stderr config.active_support.deprecation = :stderr - config.eager_load = ENV['RAILS_VERSION'] == '4.0' || ENV['RAILS_VERSION'] == '4.0-protected-attributes' + config.eager_load = false end diff --git a/test/dummy/db/migrate/20110421191249_create_users.rb b/test/dummy/db/migrate/20110421191249_create_users.rb index 00a3d026..eac6f669 100644 --- a/test/dummy/db/migrate/20110421191249_create_users.rb +++ b/test/dummy/db/migrate/20110421191249_create_users.rb @@ -1,4 +1,4 @@ -class CreateUsers < ActiveRecord::Migration +class CreateUsers < ActiveRecord::Migration[5.0] def self.up create_table :users do |t| t.string :name diff --git a/test/dummy/db/migrate/20110421191250_create_comments.rb b/test/dummy/db/migrate/20110421191250_create_comments.rb index 89a83d4b..4e51518d 100644 --- a/test/dummy/db/migrate/20110421191250_create_comments.rb +++ b/test/dummy/db/migrate/20110421191250_create_comments.rb @@ -1,4 +1,4 @@ -class CreateComments < ActiveRecord::Migration +class CreateComments < ActiveRecord::Migration[5.0] def self.up create_table :comments do |t| t.string :name diff --git a/test/dummy/db/migrate/20120318022220_add_fields_to_users.rb b/test/dummy/db/migrate/20120318022220_add_fields_to_users.rb index 688512b0..a1ce595d 100644 --- a/test/dummy/db/migrate/20120318022220_add_fields_to_users.rb +++ b/test/dummy/db/migrate/20120318022220_add_fields_to_users.rb @@ -1,4 +1,4 @@ -class AddFieldsToUsers < ActiveRecord::Migration +class AddFieldsToUsers < ActiveRecord::Migration[5.0] def self.up add_column :users, :sash_id, :integer add_column :users, :level, :integer, :default => 0 diff --git a/test/dummy/db/migrate/20130321082817_add_fields_to_comments.rb b/test/dummy/db/migrate/20130321082817_add_fields_to_comments.rb index 3815cdc9..ba08c88c 100644 --- a/test/dummy/db/migrate/20130321082817_add_fields_to_comments.rb +++ b/test/dummy/db/migrate/20130321082817_add_fields_to_comments.rb @@ -1,4 +1,4 @@ -class AddFieldsToComments < ActiveRecord::Migration +class AddFieldsToComments < ActiveRecord::Migration[5.0] def self.up add_column :comments, :sash_id, :integer add_column :comments, :level, :integer, :default => 0 diff --git a/test/dummy/db/migrate/20130329224406_create_merit_actions.rb b/test/dummy/db/migrate/20130329224406_create_merit_actions.rb index 172a7ee3..0b55a4c3 100644 --- a/test/dummy/db/migrate/20130329224406_create_merit_actions.rb +++ b/test/dummy/db/migrate/20130329224406_create_merit_actions.rb @@ -1,4 +1,4 @@ -class CreateMeritActions < ActiveRecord::Migration +class CreateMeritActions < ActiveRecord::Migration[5.0] def self.up create_table :merit_actions do |t| t.integer :user_id # source diff --git a/test/dummy/db/migrate/20130329224407_create_merit_activity_logs.rb b/test/dummy/db/migrate/20130329224407_create_merit_activity_logs.rb index d96f43d8..09410e91 100644 --- a/test/dummy/db/migrate/20130329224407_create_merit_activity_logs.rb +++ b/test/dummy/db/migrate/20130329224407_create_merit_activity_logs.rb @@ -1,4 +1,4 @@ -class CreateMeritActivityLogs < ActiveRecord::Migration +class CreateMeritActivityLogs < ActiveRecord::Migration[5.0] def self.up create_table :merit_activity_logs do |t| t.integer :action_id diff --git a/test/dummy/db/migrate/20130329224408_create_sashes.rb b/test/dummy/db/migrate/20130329224408_create_sashes.rb index d8fe1f67..13d1d65b 100644 --- a/test/dummy/db/migrate/20130329224408_create_sashes.rb +++ b/test/dummy/db/migrate/20130329224408_create_sashes.rb @@ -1,4 +1,4 @@ -class CreateSashes < ActiveRecord::Migration +class CreateSashes < ActiveRecord::Migration[5.0] def self.up create_table :sashes do |t| t.timestamps null: false diff --git a/test/dummy/db/migrate/20130329224409_create_badges_sashes.rb b/test/dummy/db/migrate/20130329224409_create_badges_sashes.rb index da4d1d47..fa0e8cff 100644 --- a/test/dummy/db/migrate/20130329224409_create_badges_sashes.rb +++ b/test/dummy/db/migrate/20130329224409_create_badges_sashes.rb @@ -1,4 +1,4 @@ -class CreateBadgesSashes < ActiveRecord::Migration +class CreateBadgesSashes < ActiveRecord::Migration[5.0] def self.up create_table :badges_sashes do |t| t.integer :badge_id, :sash_id diff --git a/test/dummy/db/migrate/20130329224410_create_scores_and_points.rb b/test/dummy/db/migrate/20130329224410_create_scores_and_points.rb index 2720dd32..01bc2da4 100644 --- a/test/dummy/db/migrate/20130329224410_create_scores_and_points.rb +++ b/test/dummy/db/migrate/20130329224410_create_scores_and_points.rb @@ -1,4 +1,4 @@ -class CreateScoresAndPoints < ActiveRecord::Migration +class CreateScoresAndPoints < ActiveRecord::Migration[5.0] def self.up create_table :merit_scores do |t| t.references :sash diff --git a/test/dummy/db/migrate/20140211144001_create_addresses.rb b/test/dummy/db/migrate/20140211144001_create_addresses.rb index 264a5fe8..8072b3ff 100644 --- a/test/dummy/db/migrate/20140211144001_create_addresses.rb +++ b/test/dummy/db/migrate/20140211144001_create_addresses.rb @@ -1,4 +1,4 @@ -class CreateAddresses < ActiveRecord::Migration +class CreateAddresses < ActiveRecord::Migration[5.0] def up create_table :addresses do |t| t.references :user diff --git a/test/dummy/db/migrate/20140819133931_add_target_data_to_merit_actions.rb b/test/dummy/db/migrate/20140819133931_add_target_data_to_merit_actions.rb index 4d9e3fca..1a8b1bb4 100644 --- a/test/dummy/db/migrate/20140819133931_add_target_data_to_merit_actions.rb +++ b/test/dummy/db/migrate/20140819133931_add_target_data_to_merit_actions.rb @@ -1,4 +1,4 @@ -class AddTargetDataToMeritActions < ActiveRecord::Migration +class AddTargetDataToMeritActions < ActiveRecord::Migration[5.0] def change add_column :merit_actions, :target_data, :text end diff --git a/test/dummy/db/migrate/20140906225844_create_players.rb b/test/dummy/db/migrate/20140906225844_create_players.rb index e01052c9..cc6d06d0 100644 --- a/test/dummy/db/migrate/20140906225844_create_players.rb +++ b/test/dummy/db/migrate/20140906225844_create_players.rb @@ -1,4 +1,4 @@ -class CreatePlayers < ActiveRecord::Migration +class CreatePlayers < ActiveRecord::Migration[5.0] def change create_table :players do |t| t.integer :sash_id