You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to be able to cast the values to an Array subclass with named getter methods, instead of an actual Array. That will let me turn this:
Scores.all.values_of(:user_id, :scale_id, :score).each do |s|
if s[0] == current_user.id and s[1] * s[2] = 5 then put "magic numbers!"
end
into this:
Scores.all.values_of(:user_id, :scale_id, :score).each do |s|
if s.user_id == current_user.id and s.scale_id * s.score = 5 then put "literate code!"
end
Would you accept such a patch?
The text was updated successfully, but these errors were encountered:
I considered going that route at first, but it adds a bit of overhead, and I'm not really sure what the benefit would be in the simplest use cases such as outlined above, when you can do:
I'd like to be able to cast the values to an Array subclass with named getter methods, instead of an actual Array. That will let me turn this:
into this:
Would you accept such a patch?
The text was updated successfully, but these errors were encountered: