Bad Hombre
Bad Hombre

Reputation: 594

block in assert_valid_keys: Unknown key: :optional (ArgumentError)

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?

Upvotes: 1

Views: 1817

Answers (1)

JoshMc
JoshMc

Reputation: 21

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.

Upvotes: 1

Related Questions