rails-engine/notifications

Rails 4.2.8 probelm with optional: true

grzegorz-jakubiak opened this issue · 2 comments

I've got a problem and I get:

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

I tried solving it this way and I reopened module in lib directory and added code like this:

module Notifications
  module Model
    included do
      belongs_to :actor, class_name: Notifications.config.user_class
      belongs_to :user, class_name: Notifications.config.user_class

      belongs_to :target, polymorphic: true
      belongs_to :second_target, polymorphic: true
      belongs_to :third_target, polymorphic: true

      scope :unread, -> { where(read_at: nil) }
    end
  end
end

But it still doesn't work.

insub commented

+1 ...

gem 'notifications', '~> 0.5.0'

Only 0.5.x for support Rails 4.2