Fix some deprecations in Rails 4 #946

Merged
merged 14 commits into from Jul 9, 2013

Conversation

Projects
None yet
4 participants
@justinfrench
Owner

justinfrench commented Jul 4, 2013

  • source :rubygems is a deprecation
  • Model.scoped needs to be Model.all in Rails 4
  • test against 4.0.0
@sobrinho

This comment has been minimized.

Show comment Hide comment
@sobrinho

sobrinho Jul 5, 2013

Collaborator

Seems okay! 👍

Collaborator

sobrinho commented Jul 5, 2013

Seems okay! 👍

@justinfrench

This comment has been minimized.

Show comment Hide comment
@justinfrench

justinfrench Jul 6, 2013

Owner

@sobrinho it's failing under Rails 4 still (Rails 4 was marked as "allowed to fail" in Travis when this ran) — fixing all the places where an :all is stubbed with an array instead of an association proxy is "fun" :) Working on it, still a few more commits to go in this PR, but it seems to be bad stubs, not bad code so far, so should be safe to use this branch.

Owner

justinfrench commented Jul 6, 2013

@sobrinho it's failing under Rails 4 still (Rails 4 was marked as "allowed to fail" in Travis when this ran) — fixing all the places where an :all is stubbed with an array instead of an association proxy is "fun" :) Working on it, still a few more commits to go in this PR, but it seems to be bad stubs, not bad code so far, so should be safe to use this branch.

justinfrench added some commits Jul 8, 2013

Appraisable updates:
* always build rails-4 from gem
* build rails-edge from git
* updated gemfiles
Model.all spec changes for Rails 4
In Rails 3 Model.all returns an Array. In Rails 4 it returns an association proxy. Most of these changes are so that Rails 3 tests get an Array, and Rails 4 get a thing that quacks like an association proxy.
@justinfrench

This comment has been minimized.

Show comment Hide comment
@justinfrench

justinfrench Jul 8, 2013

Owner

@sobrinho @twalpole @yabawock I've got the majority of specs passing again with Rails 3, 3.1, 3.2 and 4.

I had to mark a few as pending that I was stuck on. If you have time, could I get some help looking at any pending specs (look for xit)?

Mostly it's issues with Model.all, but there's something going on with InputsHelper and blocks. In particular, the inputs_spec_helper.rb ones that test :for with circular references to inputs() and a whole lot of crazy stuff :)

Owner

justinfrench commented Jul 8, 2013

@sobrinho @twalpole @yabawock I've got the majority of specs passing again with Rails 3, 3.1, 3.2 and 4.

I had to mark a few as pending that I was stuck on. If you have time, could I get some help looking at any pending specs (look for xit)?

Mostly it's issues with Model.all, but there's something going on with InputsHelper and blocks. In particular, the inputs_spec_helper.rb ones that test :for with circular references to inputs() and a whole lot of crazy stuff :)

@justinfrench

This comment has been minimized.

Show comment Hide comment
@justinfrench

justinfrench Jul 8, 2013

Owner

"Could not find gem 'activemodel (>= 0) ruby' in the gems available on this machine." WTF Travis CI? I'm going to bed :)

Owner

justinfrench commented Jul 8, 2013

"Could not find gem 'activemodel (>= 0) ruby' in the gems available on this machine." WTF Travis CI? I'm going to bed :)

@twalpole

This comment has been minimized.

Show comment Hide comment
@twalpole

twalpole Jul 8, 2013

Collaborator

@justinfrecnch Ok - problem 1 is that the block isn't being passed through to array.each in MockScope -- working on the next issue :)

Collaborator

twalpole commented Jul 8, 2013

@justinfrecnch Ok - problem 1 is that the block isn't being passed through to array.each in MockScope -- working on the next issue :)

@twalpole

This comment has been minimized.

Show comment Hide comment
@twalpole

twalpole Jul 8, 2013

Collaborator

@justinfrench - same with map

Collaborator

twalpole commented Jul 8, 2013

@justinfrench - same with map

@twalpole

This comment has been minimized.

Show comment Hide comment
@twalpole

twalpole Jul 8, 2013

Collaborator

@justinfrench ok - I think thats all the xit tests fixed

Collaborator

twalpole commented Jul 8, 2013

@justinfrench ok - I think thats all the xit tests fixed

@justinfrench

This comment has been minimized.

Show comment Hide comment
@justinfrench

justinfrench Jul 9, 2013

Owner

Any further thoughts before we merge this and put out an RC?

Owner

justinfrench commented Jul 9, 2013

Any further thoughts before we merge this and put out an RC?

@twalpole

This comment has been minimized.

Show comment Hide comment
@twalpole

twalpole Jul 9, 2013

Collaborator

I believe Model.all taking parameters is deprecated so we should probably fix that too - I'll take a look at how much that involves

Collaborator

twalpole commented Jul 9, 2013

I believe Model.all taking parameters is deprecated so we should probably fix that too - I'll take a look at how much that involves

@twalpole

This comment has been minimized.

Show comment Hide comment
@twalpole

twalpole Jul 9, 2013

Collaborator

ok - I think that should fix it -- please take a look and make sure I didn't miss something obvious

Collaborator

twalpole commented Jul 9, 2013

ok - I think that should fix it -- please take a look and make sure I didn't miss something obvious

@mjonuschat

This comment has been minimized.

Show comment Hide comment
@mjonuschat

mjonuschat Jul 9, 2013

Collaborator

Looking good to me - nothing obvious comes to mind.

Collaborator

mjonuschat commented Jul 9, 2013

Looking good to me - nothing obvious comes to mind.

@justinfrench

This comment has been minimized.

Show comment Hide comment
@justinfrench

justinfrench Jul 9, 2013

Owner

Merging in, thanks everyone for your help!

Owner

justinfrench commented Jul 9, 2013

Merging in, thanks everyone for your help!

justinfrench added a commit that referenced this pull request Jul 9, 2013

Merge pull request #946 from justinfrench/rails4
Fix deprecations and compatibility issues in Rails 4.

@justinfrench justinfrench merged commit 6dd0e0f into master Jul 9, 2013

1 check passed

default The Travis CI build passed
Details

@justinfrench justinfrench deleted the rails4 branch Jul 9, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment