Sha256: 014dfcd8737f2c494d55e7ed94b3796508bb3aa4e27be5d76bb2eccd90fd3738

Contents?: true

Size: 784 Bytes

Versions: 14

Compression:

Stored size: 784 Bytes

Contents

class EffectiveCustomersDatatable < Effective::Datatable
   datatable do

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

    if EffectiveOrders.stripe_enabled
      col :stripe_customer_id
      col :active_card
    end

    if EffectiveOrders.stripe_connect_enabled
      col :stripe_connect_access_token
    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

14 entries across 14 versions & 1 rubygems

Version Path
effective_orders-3.2.3 app/datatables/effective_customers_datatable.rb
effective_orders-3.2.2 app/datatables/effective_customers_datatable.rb
effective_orders-3.2.1 app/datatables/effective_customers_datatable.rb
effective_orders-3.2.0 app/datatables/effective_customers_datatable.rb
effective_orders-3.1.7 app/datatables/effective_customers_datatable.rb
effective_orders-3.1.6 app/datatables/effective_customers_datatable.rb
effective_orders-3.1.4 app/datatables/effective_customers_datatable.rb
effective_orders-3.1.3 app/datatables/effective_customers_datatable.rb
effective_orders-3.1.0 app/datatables/effective_customers_datatable.rb
effective_orders-3.0.4 app/datatables/effective_customers_datatable.rb
effective_orders-3.0.3 app/datatables/effective_customers_datatable.rb
effective_orders-3.0.2 app/datatables/effective_customers_datatable.rb
effective_orders-3.0.1 app/datatables/effective_customers_datatable.rb
effective_orders-3.0.0 app/datatables/effective_customers_datatable.rb