I want to update the :position_status in the model based on if :position_date which is equal Date.today, let say I have the :position_date which is Mon, 26 Oct 2017 stored in the database, if the Date.today is on that particular date, then update the :position_status
I have tried to change the position_date to today date to see if it will update or not, but the :position_date was not updated.
attr_accessor :update_position_status
def update_position_status
if Date.today == self.position_date
self.update_attribute(:position_status => 'Filled')
end
end
Yes
update_attributerequires two arguments.The correct syntax is: