1
votes

Upon pushing my latest commit to heroku, I've been recieving this error, and can't seem to find where it's coming from:

app[web.1]: /app/vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.5.1/lib/active_support/core_ext/hash/keys.rb:75:in `block in assert_valid_keys': Unknown key: :optional. Valid keys are: :class_name, :anonymous_class, :foreign_key, :validate, :autosave, :dependent, :primary_key, :inverse_of, :required, :foreign_type, :polymorphic, :touch, :counter_cache (Argum entError)

Can't seem to figure out why am recieving this error when in development it doesn't occur. Any ideas?

1
Can you post your models? Also Which Rails version are you using? - Pavan
@Pavan I'm using rails version 4.2.5.1, unless I must upgrade the version I will provide the models though the :optional method/key is not used in any of them. - Bad Hombre
It seems that you have optional key somewhere in your code. If so it has been added in Rails 5.x - Pavan
@Pavan I don't recall using the optional key ever as my code has been working in production fine except the last few days. Is this caused due to using an older version of Rails? - Bad Hombre

1 Answers

1
votes

I found that i can get this error if i put the optional key on the has_many side of the model. It is only defined for the belongs_to side.