Module: Promiscuous::Subscriber::Model::Observer::ClassMethods

Defined in:
lib/promiscuous/subscriber/model/observer.rb

Instance Method Summary collapse

Instance Method Details

#__promiscuous_duplicate_key_exception?(e) ⇒ Boolean

Returns:

  • (Boolean)


52
53
54
# File 'lib/promiscuous/subscriber/model/observer.rb', line 52

def __promiscuous_duplicate_key_exception?(e)
  false
end

#__promiscuous_fetch_new(id) ⇒ Object Also known as: __promiscuous_fetch_existing



47
48
49
# File 'lib/promiscuous/subscriber/model/observer.rb', line 47

def __promiscuous_fetch_new(id)
  new.tap { |o| o.id = id }
end

#subscribe(*args) ⇒ Object



39
40
41
42
43
44
45
# File 'lib/promiscuous/subscriber/model/observer.rb', line 39

def subscribe(*args)
  super
  subscribed_attrs.each do |attr|
    # TODO do not overwrite existing methods
    attr_accessor attr
  end
end