I am trying to insert data in my database using ActiveRecord.
When I use pdays = MyModel.new for initialization rather then the below find_or_initiali
pdays = MyModel.new
find_or_initiali
I read here that in Rails 4, this is the correct syntax:
Progress.find_or_initialize_by(chore_id: chore.id, period: period[chore.frequency], account_id: chore.account_id)