Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drops action_filter support #276

Merged
merged 1 commit into from
Jul 18, 2017
Merged

Conversation

bgreg
Copy link
Contributor

@bgreg bgreg commented Jul 17, 2017

This small change fixes the rails 5.1.2 error, and hard codes the after_action callback.

@tute
Copy link
Member

tute commented Jul 17, 2017

Yep! Shall we update the Travis CI matrix to disallow unsupported Rails' versions, and do a major release? Thanks!

@tute
Copy link
Member

tute commented Jul 17, 2017

Related with: #274. We'll also want to update the gemspec.

@bgreg
Copy link
Contributor Author

bgreg commented Jul 17, 2017

I'm looking at that travis build now.

@tute
Copy link
Member

tute commented Jul 17, 2017

I'm fine ignoring most Hound comments in this PR. Thanks for your work!

@bgreg
Copy link
Contributor Author

bgreg commented Jul 17, 2017

@tute What do you think about this case statement from the Gemfile. Looks like it will be dead code too:

# /Gemfile
version = ENV['RAILS_VERSION'] || '5.0'
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

@tute
Copy link
Member

tute commented Jul 17, 2017

@tute What do you think about this case statement from the Gemfile. Looks like it will be dead code too:

Yep! We can delete the rails local variable, and use version instead. Love this.

@bgreg
Copy link
Contributor Author

bgreg commented Jul 17, 2017

Cool, will do. Also, there is something I don't understand about travis. Why is it running versions of rails other than what I have specified on this branch? Is it also using the master version of the .travis.yml file?

@tute
Copy link
Member

tute commented Jul 17, 2017

Cool, will do. Also, there is something I don't understand about travis. Why is it running versions of rails other than what I have specified on this branch? Is it also using the master version of the .travis.yml file?

It looks like! Shouldn't be running 4.2. Let's ignore those for now.

@tute
Copy link
Member

tute commented Jul 17, 2017

Don't forget it seems we can clean up some code in test/dummy/config/environments/test.rb.

@tute
Copy link
Member

tute commented Jul 17, 2017

I have no problem with this, given people on 5 can use merit ~2. But curious, what bugs were we hitting?

I'd rather keep 5 if we can. 5.0 and 5.1 are similar enough for us.

@bgreg
Copy link
Contributor Author

bgreg commented Jul 17, 2017

I was getting 'ArgumentError: key must be 32 byte' when running against 5.0.0.0. Oddly enough I can't reproduce that again. I'll give travis another chance at ~> 5.0, and fix that test.rb file.

@bgreg
Copy link
Contributor Author

bgreg commented Jul 17, 2017

Dropping that from the dummy env files causes:

config.eager_load is set to nil. Please update your config/environments/*.rb files accordingly:

  * development - set it to false
  * test - set it to false (unless you use a tool that preloads your test environment)
  * production - set it to true

But turning off warnings seems nice. Sending another build

@bgreg
Copy link
Contributor Author

bgreg commented Jul 17, 2017

I'm stuck on this failure right now: https://travis-ci.org/merit-gem/merit/jobs/254626719

@bgreg
Copy link
Contributor Author

bgreg commented Jul 17, 2017

@tute could use some input, running out of easy fix ideas for this:

Finished in 1.759557s, 25.5746 runs/s, 74.4506 assertions/s.
/home/travis/build/merit-gem/merit/vendor/bundle/ruby/2.4.0/gems/railties-5.1.0/lib/rails/test_unit/minitest_plugin.rb:9:in `aggregated_results': wrong number of arguments (given 1, expected 0) (ArgumentError)
	from /home/travis/build/merit-gem/merit/vendor/bundle/ruby/2.4.0/gems/minitest-5.10.2/lib/minitest.rb:597:in `report'
	from /home/travis/build/merit-gem/merit/vendor/bundle/ruby/2.4.0/gems/minitest-5.10.2/lib/minitest.rb:687:in `each'
	from /home/travis/build/merit-gem/merit/vendor/bundle/ruby/2.4.0/gems/minitest-5.10.2/lib/minitest.rb:687:in `report'
	from /home/travis/build/merit-gem/merit/vendor/bundle/ruby/2.4.0/gems/minitest-5.10.2/lib/minitest.rb:141:in `run'
	from /home/travis/build/merit-gem/merit/vendor/bundle/ruby/2.4.0/gems/railties-5.1.0/lib/rails/test_unit/minitest_plugin.rb:77:in `run'
	from /home/travis/build/merit-gem/merit/vendor/bundle/ruby/2.4.0/gems/minitest-5.10.2/lib/minitest.rb:63:in `block in autorun'
rake aborted!

What do you think?

@tute
Copy link
Member

tute commented Jul 17, 2017

Apparently minitest 5.10.2 has an issue. We can specify versions minitest '~> 5.10', '!= 5.10.2', or later.

@bgreg
Copy link
Contributor Author

bgreg commented Jul 17, 2017

Making progress. Just some trial and error finding the lowest rails 5 version to support.

@bgreg
Copy link
Contributor Author

bgreg commented Jul 18, 2017

@tute if you agree, can you click resolve on that travis file?

@tute
Copy link
Member

tute commented Jul 18, 2017

aha, that means your branch was born before latest master.

Can you please squash your commits together, and rebase them on top of latest master? I wrote instructions for this in https://robots.thoughtbot.com/git-interactive-rebase-squash-amend-rewriting-history. That'd resolve the conflicts in the process. Let me know if I can help you do this.

Thanks for all the work! :)

@merit-gem merit-gem deleted a comment from houndci-bot Jul 18, 2017
@merit-gem merit-gem deleted a comment from houndci-bot Jul 18, 2017
@merit-gem merit-gem deleted a comment from houndci-bot Jul 18, 2017
@merit-gem merit-gem deleted a comment from houndci-bot Jul 18, 2017
@merit-gem merit-gem deleted a comment from houndci-bot Jul 18, 2017
@merit-gem merit-gem deleted a comment from houndci-bot Jul 18, 2017
@merit-gem merit-gem deleted a comment from houndci-bot Jul 18, 2017
@merit-gem merit-gem deleted a comment from houndci-bot Jul 18, 2017
@merit-gem merit-gem deleted a comment from houndci-bot Jul 18, 2017
@merit-gem merit-gem deleted a comment from houndci-bot Jul 18, 2017
@merit-gem merit-gem deleted a comment from houndci-bot Jul 18, 2017
@merit-gem merit-gem deleted a comment from houndci-bot Jul 18, 2017
@merit-gem merit-gem deleted a comment from houndci-bot Jul 18, 2017
@merit-gem merit-gem deleted a comment from houndci-bot Jul 18, 2017
@merit-gem merit-gem deleted a comment from houndci-bot Jul 18, 2017
@merit-gem merit-gem deleted a comment from houndci-bot Jul 18, 2017
@merit-gem merit-gem deleted a comment from houndci-bot Jul 18, 2017
@merit-gem merit-gem deleted a comment from houndci-bot Jul 18, 2017
@merit-gem merit-gem deleted a comment from houndci-bot Jul 18, 2017
@merit-gem merit-gem deleted a comment from houndci-bot Jul 18, 2017
@merit-gem merit-gem deleted a comment from houndci-bot Jul 18, 2017
@merit-gem merit-gem deleted a comment from houndci-bot Jul 18, 2017
@merit-gem merit-gem deleted a comment from houndci-bot Jul 18, 2017
@merit-gem merit-gem deleted a comment from houndci-bot Jul 18, 2017
Rakefile Outdated
t.pattern = 'test/**/*_test.rb'
t.verbose = true
t.pattern = 'test/**/*_test.rb'
t.verbose = true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need of the extra white space here

else
base.after_filter :log_and_process
end
base.after_action :log_and_process
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes!

.travis.yml Outdated

env:
- RAILS_VERSION=5.0
- RAILS_VERSION=5.0.3
- RAILS_VERSION=5.1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There will be changes to merge from latest master, when you rebase you'll see them.

This change drops some version specific code as well as moving the dummy
test app to be rails 5 compatible.
@bgreg bgreg force-pushed the controller-rails5-updates branch from e0351db to dd7b05a Compare July 18, 2017 19:10
@@ -1,4 +1,4 @@
class CreatePlayers < ActiveRecord::Migration
class CreatePlayers < ActiveRecord::Migration[5.0]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing magic comment # frozen_string_literal: true.

@@ -1,4 +1,4 @@
class AddTargetDataToMeritActions < ActiveRecord::Migration
class AddTargetDataToMeritActions < ActiveRecord::Migration[5.0]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing magic comment # frozen_string_literal: true.

@@ -1,4 +1,4 @@
class CreateAddresses < ActiveRecord::Migration
class CreateAddresses < ActiveRecord::Migration[5.0]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing magic comment # frozen_string_literal: true.

@@ -1,4 +1,4 @@
class CreateScoresAndPoints < ActiveRecord::Migration
class CreateScoresAndPoints < ActiveRecord::Migration[5.0]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing magic comment # frozen_string_literal: true.

@@ -1,4 +1,4 @@
class CreateBadgesSashes < ActiveRecord::Migration
class CreateBadgesSashes < ActiveRecord::Migration[5.0]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing magic comment # frozen_string_literal: true.

@@ -1,4 +1,4 @@
class CreateMeritActions < ActiveRecord::Migration
class CreateMeritActions < ActiveRecord::Migration[5.0]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing magic comment # frozen_string_literal: true.

@@ -1,4 +1,4 @@
class AddFieldsToComments < ActiveRecord::Migration
class AddFieldsToComments < ActiveRecord::Migration[5.0]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing magic comment # frozen_string_literal: true.

@@ -1,4 +1,4 @@
class AddFieldsToUsers < ActiveRecord::Migration
class AddFieldsToUsers < ActiveRecord::Migration[5.0]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing magic comment # frozen_string_literal: true.

@@ -1,4 +1,4 @@
class CreateComments < ActiveRecord::Migration
class CreateComments < ActiveRecord::Migration[5.0]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing magic comment # frozen_string_literal: true.

@@ -1,4 +1,4 @@
class CreateUsers < ActiveRecord::Migration
class CreateUsers < ActiveRecord::Migration[5.0]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing magic comment # frozen_string_literal: true.

@bgreg
Copy link
Contributor Author

bgreg commented Jul 18, 2017

@tute ok, git surgery done. I think this might be ready for a final review. Thanks for being responsive ! It's a lot more fun when someone is working with me.

@tute tute merged commit 3802735 into merit-gem:master Jul 18, 2017
@tute
Copy link
Member

tute commented Jul 18, 2017

Thanks a lot! :)

@bgreg bgreg deleted the controller-rails5-updates branch July 18, 2017 19:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants