I have a app working great on Rails 4.0.3 Today when I try to upgrade to Rails 4.2.0, error happened with the code below:
def self.create_comp(comp)
c= Competition.new(comp[:competition])
# add activities
comp[:activities].each do |act|
c.activities.new(act)
end
c.save!
c
end
And error message:
ActiveModel::ForbiddenAttributesError (ActiveModel::ForbiddenAttributesError):
What this function does is to save a competition with its associated activities in transaction.
I have the following line defined as association:
has_many :activities, autosave: true
So what has been changed in Rails 4.2 to make it throw this exception?