Skip to content

Commit

Permalink
Merge pull request #276 from bgreg/controller-rails5-updates
Browse files Browse the repository at this point in the history
Drops action_filter support
  • Loading branch information
tute authored Jul 18, 2017
2 parents ea9646c + dd7b05a commit 3802735
Show file tree
Hide file tree
Showing 17 changed files with 21 additions and 40 deletions.
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
21 changes: 3 additions & 18 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -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

Expand Down
6 changes: 1 addition & 5 deletions lib/merit/controller_extensions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions merit.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion test/dummy/config/environments/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion test/dummy/db/migrate/20110421191249_create_users.rb
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/dummy/db/migrate/20110421191250_create_comments.rb
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/dummy/db/migrate/20130329224408_create_sashes.rb
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/dummy/db/migrate/20140211144001_create_addresses.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class CreateAddresses < ActiveRecord::Migration
class CreateAddresses < ActiveRecord::Migration[5.0]
def up
create_table :addresses do |t|
t.references :user
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class AddTargetDataToMeritActions < ActiveRecord::Migration
class AddTargetDataToMeritActions < ActiveRecord::Migration[5.0]
def change
add_column :merit_actions, :target_data, :text
end
Expand Down
2 changes: 1 addition & 1 deletion test/dummy/db/migrate/20140906225844_create_players.rb
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 3802735

Please sign in to comment.