-
-
Notifications
You must be signed in to change notification settings - Fork 909
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
WIP: Add support for Rails 5 #960
Conversation
The protected_attributes gem is not compatible for Rails 5, and we don't need it anyway with Strong Parameters.
context 'an active_resource model' do | ||
context 'with the validation context' do | ||
it 'does not raise an exception' do | ||
expect { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid using {...} for multi-line blocks.
end | ||
|
||
it 'accepts being mass-assignable for admin' do | ||
expect(mass_assignable_as_admin).to allow_mass_assignment_of(:attr).as(:admin) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is too long. [88/80]
I came across this from: @mcmire - do you have any idea on when you might be done with this? Appreciate the work BTW. |
Hey @stevebissett, Sorry for the wait on this. Unfortunately I don't really have a timeline for when this will be complete. I tend to work on it whenever I have time and I haven't had a whole lot of that lately. |
Hey @mcmire, I saw you sadly no longer have the time to maintain this project. I wanna start off by saying Thanks! for all your efforts so far! 👍 But wrt to this PR, would you be open to drop the conditionals for ActiveModel 3 and maybe some older Rails 4.x versions in favor of supporting Rails 5.0 and the upcoming 5.1 which will remove a lot of deprecated functions. It would require a new major release, but also means that there would be a working version of shoulda-matchers (3.x) for older Rails versions and a new, lighter version (because of dropping support) of it? I even see |
@aried3r Thanks for the support, it means a lot. :) Yeah, I am totally open to that. In fact for shoulda I have already removed support for Rails < 4.2: thoughtbot/shoulda@b9353e2, so I think we could definitely do the same thing here and release a new major version. |
Hey @mcmire I just wanted to check in and see if there's any update on the timeline for this. I appreciate all the work you've put into this project and would like to see it continue to be compatible with Rails versions going into the future! |
Hi, @em77 . |
@guialbuk Hey thanks for the encouraging reply. So that branch is considered safe for rails 5.1? Is there any documentation of what methods or functionality are not working properly on rails 5.0 and 5.1? |
@em77 It is safe to use on Rails 5.0 and 5.1 The list on the top of this PR ( |
(EDIT) Actually I think what I'll do is close this. @guialbuk is right -- if you'd like to know where things are at in terms of getting shoulda-matchers up to date with the latest Ruby and Rails changes, we've properly labeled open issues and PRs with Ruby 2.4 and Rails 5 tags, and it's easier to let GitHub keep that list automatically than aggregating one manually. Also, the |
validate_inclusion_of
so that it only checks ifminimum
is 0 if the column is a numeric columnget
,post
, etc.) so that they use keyword arguments (DEPRECATION WARNING: request methods will accept only keyword arguments in future Rails versions. #867, fixed by Scope parameters according to Rails version #964)serialize
so that it does not refer tocast_type
(cast_type
use in rails_shim causes a problem with the serialize matcher - Rails 5 #913)connection.tables
, useconnection.data_sources
(DEPRECATION WARNING: #tables currently returns both tables and views. #933, fixed by Fix #tables deprecation in Rails 5.0 - Fixes #933 #943)have_db_index
so it works with expressions as well as columns (have_db_index: normalize_columns_to_array is always an array #945)validate_uniqueness_of
when used with a boolean so it doesn't produce a warning (rails 5 depreciation warning validate_uniqueness_of for multiple scopes #949)route
to support aport
option (Support env named parameter to import SERVER_PORT header. #954)validate_presence_of
as the validation message changed (#861)