Sha256: 5ba9c3484c870404d074b26849edf4a15fe06681991739f5bbb9364077a3a2a9

Contents?: true

Size: 683 Bytes

Versions: 21

Compression:

Stored size: 683 Bytes

Contents

class EffectiveCustomersDatatable < Effective::Datatable
   datatable do

    col :id, visible: false
    #col 'user.email'

    if EffectiveOrders.stripe?
      col :stripe_customer_id
      col :active_card
    end

    actions_col do |customer|
      link_to('Manage', "https://dashboard.stripe.com/#{'test/' if Rails.env.development?}customers/#{customer.stripe_customer_id}")
    end

  end

  collection do
    Effective::Customer.joins(:user).all
  end

  # def search_column(collection, table_column, search_term)
  #   return collection.where('subscriptions.stripe_plan_id ILIKE ?', "%#{search_term}%") if table_column[:name] == 'subscription_types'
  #   super
  # end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
effective_orders-4.0.1 app/datatables/effective_customers_datatable.rb
effective_orders-4.0.0 app/datatables/effective_customers_datatable.rb
effective_orders-4.0.0beta19 app/datatables/effective_customers_datatable.rb
effective_orders-4.0.0beta18 app/datatables/effective_customers_datatable.rb
effective_orders-4.0.0beta17 app/datatables/effective_customers_datatable.rb
effective_orders-4.0.0beta16 app/datatables/effective_customers_datatable.rb
effective_orders-4.0.0beta15 app/datatables/effective_customers_datatable.rb
effective_orders-4.0.0beta14 app/datatables/effective_customers_datatable.rb
effective_orders-4.0.0beta13 app/datatables/effective_customers_datatable.rb
effective_orders-4.0.0beta12 app/datatables/effective_customers_datatable.rb
effective_orders-4.0.0beta11 app/datatables/effective_customers_datatable.rb
effective_orders-4.0.0beta10 app/datatables/effective_customers_datatable.rb
effective_orders-4.0.0beta9 app/datatables/effective_customers_datatable.rb
effective_orders-4.0.0beta8 app/datatables/effective_customers_datatable.rb
effective_orders-4.0.0beta7 app/datatables/effective_customers_datatable.rb
effective_orders-4.0.0beta6 app/datatables/effective_customers_datatable.rb
effective_orders-4.0.0beta5 app/datatables/effective_customers_datatable.rb
effective_orders-4.0.0beta4 app/datatables/effective_customers_datatable.rb
effective_orders-4.0.0beta3 app/datatables/effective_customers_datatable.rb
effective_orders-4.0.0beta2 app/datatables/effective_customers_datatable.rb