app/models/doc_mailer_maker.rb
# Updates documentation task metadata (+last_sent_at+) and assigns the doc to
# the subscription.
Updates documentation task metadata (+last_sent_at+) and assigns the doc to
the subscription.
Updates documentation task metadata ( + last_sent_at + ) and assigns the doc to the subscription .
def assign_doc_to_subscription(doc, sub)
    return if doc.blank?
    return doc if sub.doc_assignments.detect { |da| da.doc_method_id == doc.id }
    ActiveRecord::Base.transaction do
      sub.doc_assignments.create!(doc_method_id: doc.id)
      sub.update(last_sent_at: Time.now)
    end
    doc
  end
def assign_doc_to_subscription ( doc , sub ) return if doc . blank? return doc if sub . doc_assignments . detect { | da | da . doc_method_id == doc . id } ActiveRecord :: Base . transaction do sub . doc_assignments . create! ( doc_method_id : doc . id ) sub . update ( last_sent_at : Time . now ) end doc end
Updates documentation task metadata (+last_sent_at+) and assigns the doc to
the subscription.
Updates documentation task metadata ( + last_sent_at + ) and assigns the doc to the subscription .
doc
<not_specific>
sub
<not_specific>