Sha256: 26daf9b61d5ff56fdea49539b12b810e4cc8b9b731c5e5d4924f1023fedc5c65

Contents?: true

Size: 390 Bytes

Versions: 6

Compression:

Stored size: 390 Bytes

Contents

class FormDecorator < ApplicationDecorator
  delegate_all

  def datagrid
    @datagrid ||= Udongo::Forms::SubmissionDatagrid.new(object)
  end

  def datagrid_fields_configured?
    Udongo.config.forms.send(identifier).datagrid_fields.any?
  end

  def email_present?
    return false if datagrid_fields_configured?
    data.select('DISTINCT name').map(&:name).include?('email')
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
udongo-2.0.4 app/decorators/form_decorator.rb
udongo-2.0.3 app/decorators/form_decorator.rb
udongo-2.0.2 app/decorators/form_decorator.rb
udongo-2.0.1 app/decorators/form_decorator.rb
udongo-2.0.0 app/decorators/form_decorator.rb
udongo-1.0.4 app/decorators/form_decorator.rb