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

Remove unnecessary conditions for rails 5.0 #1426

Merged
merged 9 commits into from
Mar 23, 2021
Merged

Conversation

vsppedro
Copy link
Collaborator

@vsppedro vsppedro commented Mar 7, 2021

This PR is a continuation of the Refactor ActiveRecordVersions- #1423.

I'll keep this as a draft meanwhile the other PR is not merged.

@vsppedro vsppedro marked this pull request as ready for review March 9, 2021 21:46
@vsppedro vsppedro requested a review from mcmire March 9, 2021 21:47
@vsppedro
Copy link
Collaborator Author

Hi, @mcmire, I hope you're doing fine.

When you have some free time, would you mind taking a look at this PR and sharing your thoughts on it, please?

I think we're almost finishing removing all the support for EOL'ed Ruby and Rails releases. 🎉

@vsppedro
Copy link
Collaborator Author

vsppedro commented Mar 20, 2021

I found another file that has some conditionals that we no longer need. I will remove these methods and update this PR as soon as possible.

def action_pack_gte_5?
Gem::Requirement.new('>= 5').satisfied_by?(action_pack_version)
end
def action_pack_lt_5?
Gem::Requirement.new('< 5').satisfied_by?(action_pack_version)
end

def active_record_gte_5?
Gem::Requirement.new('>= 5').satisfied_by?(active_record_version)
end

@vsppedro vsppedro changed the title Refactor UnitUnitTests::RailsVersions Refactor UnitTests::RailsVersions Mar 20, 2021
@vsppedro vsppedro removed the request for review from mcmire March 20, 2021 23:21
@vsppedro vsppedro marked this pull request as draft March 20, 2021 23:21
@mcmire
Copy link
Collaborator

mcmire commented Mar 21, 2021

@vsppedro Okay, sounds good!

@vsppedro vsppedro changed the title Refactor UnitTests::RailsVersions Remove unnecessary conditions for rails version Mar 21, 2021
@vsppedro
Copy link
Collaborator Author

vsppedro commented Mar 21, 2021

I think that's it. I can't find any more conditionals that need to be removed for now. What do you think?

And after the merge of this PR, it seems to me that the next should be the: Remove Rails 5.0 support.

@vsppedro vsppedro marked this pull request as ready for review March 21, 2021 15:10
@vsppedro vsppedro changed the title Remove unnecessary conditions for rails version Remove unnecessary conditions for rails 5.0 Mar 21, 2021
@vsppedro vsppedro requested a review from mcmire March 21, 2021 15:11
@@ -58,12 +46,7 @@ def generate_validation_message(
end

def make_controller_request(context, verb, action, request_params)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Now that there is no logic in make_controller_request, tables_and_views, and validation_message_key_for_association_required_option, what do you think about folding this code into the place where they are used so that we can remove these methods?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I think this is a good idea! I'll do that asap. Thanks!

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done!

@vsppedro vsppedro requested a review from mcmire March 23, 2021 00:03
Copy link
Collaborator

@mcmire mcmire left a comment

Choose a reason for hiding this comment

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

Very nice! Looks great!

@vsppedro vsppedro merged commit fc08a73 into master Mar 23, 2021
@vsppedro vsppedro deleted the refactor-rails-version branch March 23, 2021 17:06
@vsppedro
Copy link
Collaborator Author

Thanks!

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.

None yet

2 participants