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

Rails 5 - Fix users_controller_spec.rb #343

Merged
merged 5 commits into from
Jul 8, 2024

Conversation

yuenmichelle1
Copy link
Collaborator

@yuenmichelle1 yuenmichelle1 commented Jul 3, 2024

Changes

  • Added version check for user_id
  • In Rails versions less than 5, PG::Results when converted to_a will cast numeric types to string. This gets fixed in Rails 5 (See rails/rails@c51f9b6 for more details)
    - Decision Choice: Chose to do a version check instead of typecasting in SQL query (eg. select id::int from etc), which makes the query more readable in UsernameCompletion.

@yuenmichelle1 yuenmichelle1 marked this pull request as ready for review July 4, 2024 00:15
@yuenmichelle1 yuenmichelle1 merged commit 0ebc883 into master Jul 8, 2024
2 checks passed
@yuenmichelle1 yuenmichelle1 deleted the rails-5-fix-users_controller_spec.rb branch July 18, 2024 20:31
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.

2 participants