app/models/unidom/contact/contact_subscription.rb in unidom-contact-0.4 vs app/models/unidom/contact/contact_subscription.rb in unidom-contact-1.0

- old
+ new

@@ -14,18 +14,18 @@ belongs_to :subscriber, polymorphic: true scope :contact_is, ->(contact) { where contact: contact } scope :subscribed_by, ->(subscriber) { where subscriber: subscriber } - def self.subscribe(contact, subscriber, name: subscriber.name, primary: false, grade: 0, priority: 0, opened_at: Time.now) - contact_is(contact).subscribed_by(subscriber).valid_at.alive.first_or_create name: name, elemental: primary, grade: grade, priority: priority, opened_at: opened_at - end + #def self.subscribe(contact, subscriber, name: subscriber.name, primary: false, grade: 0, priority: 0, opened_at: Time.now) + # contact_is(contact).subscribed_by(subscriber).valid_at.alive.first_or_create name: name, elemental: primary, grade: grade, priority: priority, opened_at: opened_at + #end - def self.subscribe!(contact, subscriber, name = subscriber.name, primary = false, grade = 0, priority = 0, opened_at = Time.now) + def self.subscribe!(contact: nil, subscriber: nil, name: subscriber.name, primary: false, grade: 0, priority: 0, opened_at: Time.now) contact_is(contact).subscribed_by(subscriber).valid_at.alive.first_or_create! name: name, elemental: primary, grade: grade, priority: priority, opened_at: opened_at end - class << self - deprecate subscribe: :subscribe!, deprecator: ActiveSupport::Deprecation.new('1.0', 'unidom-contact') - end + #class << self + # deprecate subscribe: :subscribe!, deprecator: ActiveSupport::Deprecation.new('1.0', 'unidom-contact') + #end end