issues
search
zooniverse
/
talk-api
Apache License 2.0
6
stars
0
forks
source link
Rails 5 - Fix users_controller_spec.rb
#343
Closed
yuenmichelle1
closed
2 months ago
yuenmichelle1
commented
2 months ago
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
https://github.com/rails/rails/commit/c51f9b61ce1e167f5f58f07441adcfa117694301
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.
Changes
select id::int from etc
), which makes the query more readable in UsernameCompletion.