Class: ActiveadminSelleoCms::Form

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/activeadmin_selleo_cms/form.rb

Constant Summary collapse

PDF_PATH =
Rails.root.join('public','system','pdf')

Instance Method Summary collapse

Instance Method Details

#delivery_emails(form_uuid) ⇒ Object



13
14
15
16
17
18
# File 'app/models/activeadmin_selleo_cms/form.rb', line 13

def delivery_emails(form_uuid)
  [(email || ActionMailer::Base.default[:to])] +
    answers.joins(:form_question).
        where(:activeadmin_selleo_cms_form_questions => {:question_type => FormQuestion::TYPE_EMAIL}).
        where("value IS NOT NULL AND value <> ''").where(:form_uuid => form_uuid).map(&:value)
end