Sha256: fa4c477bae77657470a985702d534ba43de1c2df1ba4e4b648e98ce68522d53b

Contents?: true

Size: 1008 Bytes

Versions: 12

Compression:

Stored size: 1008 Bytes

Contents

module Admin
  class EffectiveEventRegistrantsDatatable < Effective::Datatable
    datatable do
      col :updated_at, visible: false
      col :created_at, visible: false
      col :id, visible: false

      col :event

      col :owner, visible: false
      col :event_registration, visible: false

      if attributes[:event_id]
        col :event_ticket, search: Effective::EventTicket.where(event: event).all
      else
        col :event_ticket, search: :string
      end

      col :purchased_order

      col :first_name
      col :last_name
      col :email
      col :company
      col :number
      col :notes, label: 'Restrictions and notes'

      actions_col
    end

    collection do
      scope = Effective::EventRegistrant.deep.purchased

      if attributes[:event_id].present?
        scope = scope.where(event: event)
      end

      scope
    end

    def event
      @event ||= if attributes[:event_id]
        Effective::Event.find(attributes[:event_id])
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
effective_events-0.2.0 app/datatables/admin/effective_event_registrants_datatable.rb
effective_events-0.1.10 app/datatables/admin/effective_event_registrants_datatable.rb
effective_events-0.1.9 app/datatables/admin/effective_event_registrants_datatable.rb
effective_events-0.1.8 app/datatables/admin/effective_event_registrants_datatable.rb
effective_events-0.1.7 app/datatables/admin/effective_event_registrants_datatable.rb
effective_events-0.1.6 app/datatables/admin/effective_event_registrants_datatable.rb
effective_events-0.1.5 app/datatables/admin/effective_event_registrants_datatable.rb
effective_events-0.1.4 app/datatables/admin/effective_event_registrants_datatable.rb
effective_events-0.1.3 app/datatables/admin/effective_event_registrants_datatable.rb
effective_events-0.1.2 app/datatables/admin/effective_event_registrants_datatable.rb
effective_events-0.1.1 app/datatables/admin/effective_event_registrants_datatable.rb
effective_events-0.1.0 app/datatables/admin/effective_event_registrants_datatable.rb