I have a DailyQuote model in my rails application which has a date and price for a stock. Data in the database has been captured for this model including weekends. The weekend price values have been set as 0.
I want to change all the weekend prices for Saturday and Sunday to whatever the price was on Friday. What is the best way to do this in Ruby? To identify if a date falls on a Sat or Sun and change its value to the Fri of that weekend?
or
ask_price_fornow holds a date for which you would want to ask the price for.Getting the actual price which is corresponding to you date depends on your Model and your ORM-Library (i.e. ActiveRecord).