I\'m relatively new to Ruby. I need to keep track of a day of the week on my activity model. The code that I have so far doesn\'t seem like the most elegant solution. I am w
Ruby's Date class already has a constant defined that holds the name of the days in an array: Date::DAYNAMES.
For example, you could do something like:
days = []
Date::DAYNAMES.each_with_index { |x, i| days << [x, i] }
I don't know if I'd necessarily say that this is better, but you can definitely leverage what is already available to you.