effective_orders 1.3.12 → 1.3.13

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6c7b3b018e79698ed00c4de4515e215fe8ee9ffc
4
- data.tar.gz: d28eecbbe23937b8a46b2a21214fb8dbf3c57023
3
+ metadata.gz: a8b46b9f926b8ab975a3e81e57164dc222f14a36
4
+ data.tar.gz: 4107592428dbfde1afe5247d6a813923f5a90f1d
5
5
  SHA512:
6
- metadata.gz: 00bf45972290436dab97bd5202b7343cfde44dd31d9bbf2ae8305378384fa7d4af3d0e4ed75d959b9913567ea4828e3c6cddf5e9f10a268a9d3d7983f18d2887
7
- data.tar.gz: fcedfdc649cabf1724a7381ae5ec31d1f116956dcbc78a7d37191096647dc1377a0a0594842412e57e75d02dad02b412bcf4fcf341930101718cf10b4210b107
6
+ metadata.gz: d65f51de361cb78dcc07dc27cae84ae0e11a1946240e5cf5bdb9638e2e7ba6482d8eda7156df9659304f1423ec6f2313515068ce7c0400b407f77897c0533d02
7
+ data.tar.gz: b2e93919ec0839a2cbb1b84e343cf3a0a0ce20c6b7b33adf0e08d046eb961bad72783afc44e0312c041011fb5881a53619ab0873380b897987763e8aea47abee
@@ -2,23 +2,25 @@ if defined?(EffectiveDatatables)
2
2
  module Effective
3
3
  module Datatables
4
4
  class Customers < Effective::Datatable
5
- default_order :email, :asc
5
+ datatable do
6
+ default_order :email, :asc
6
7
 
7
- table_column :id, visible: false
8
- table_column(:email, column: 'users.email') { |user| mail_to user.email, user.email }
8
+ table_column :id, visible: false
9
+ table_column(:email, column: 'users.email') { |user| mail_to user.email, user.email }
9
10
 
10
- if EffectiveOrders.stripe_enabled
11
- table_column :stripe_customer_id
12
- table_column :stripe_active_card
13
- end
11
+ if EffectiveOrders.stripe_enabled
12
+ table_column :stripe_customer_id
13
+ table_column :stripe_active_card
14
+ end
14
15
 
15
- if EffectiveOrders.stripe_connect_enabled
16
- table_column :stripe_connect_access_token
17
- end
16
+ if EffectiveOrders.stripe_connect_enabled
17
+ table_column :stripe_connect_access_token
18
+ end
18
19
 
19
- table_column :subscription_types, column: 'subscription_types'
20
+ table_column :subscription_types, column: 'subscription_types'
20
21
 
21
- table_column :actions, sortable: false, filter: false, partial: '/admin/customers/actions'
22
+ table_column :actions, sortable: false, filter: false, partial: '/admin/customers/actions'
23
+ end
22
24
 
23
25
  def collection
24
26
  Effective::Customer.customers.uniq
@@ -2,43 +2,45 @@ if defined?(EffectiveDatatables)
2
2
  module Effective
3
3
  module Datatables
4
4
  class OrderItems < Effective::Datatable
5
- default_order :purchased_at, :desc
5
+ datatable do
6
+ default_order :purchased_at, :desc
6
7
 
7
- table_column(:purchased_at, :type => :datetime, :column => 'orders.purchased_at') do |order_item|
8
- Time.at(order_item[:purchased_at]).in_time_zone if order_item[:purchased_at].present?
9
- end
8
+ table_column(:purchased_at, :type => :datetime, :column => 'orders.purchased_at') do |order_item|
9
+ Time.at(order_item[:purchased_at]).in_time_zone if order_item[:purchased_at].present?
10
+ end
10
11
 
11
- table_column :id, :visible => false
12
+ table_column :id, :visible => false
12
13
 
13
- table_column(:order, :type => :obfuscated_id, :sortable => false) do |order_item|
14
- obfuscated_id = Effective::Order.obfuscate(order_item[:order_id])
15
- link_to(obfuscated_id, (datatables_admin_path? ? effective_orders.admin_order_path(obfuscated_id) : effective_orders.order_path(obfuscated_id)))
16
- end
14
+ table_column(:order, :type => :obfuscated_id, :sortable => false) do |order_item|
15
+ obfuscated_id = Effective::Order.obfuscate(order_item[:order_id])
16
+ link_to(obfuscated_id, (datatables_admin_path? ? effective_orders.admin_order_path(obfuscated_id) : effective_orders.order_path(obfuscated_id)))
17
+ end
17
18
 
18
- table_column :email, column: 'users.email', label: 'Buyer Email', if: proc { attributes[:user_id].blank? } do |order_item|
19
- link_to order_item[:email], (edit_admin_user_path(order_item[:user_id]) rescue admin_user_path(order_item[:user_id]) rescue '#')
20
- end
19
+ table_column :email, column: 'users.email', label: 'Buyer Email', if: proc { attributes[:user_id].blank? } do |order_item|
20
+ link_to order_item[:email], (edit_admin_user_path(order_item[:user_id]) rescue admin_user_path(order_item[:user_id]) rescue '#')
21
+ end
21
22
 
22
- if EffectiveOrders.require_billing_address
23
- table_column :buyer_name, sortable: false, label: 'Buyer Name', if: proc { attributes[:user_id].blank? } do |order_item|
24
- (order_item[:buyer_name] || '').split('!!SEP!!').find(&:present?)
23
+ if EffectiveOrders.require_billing_address
24
+ table_column :buyer_name, sortable: false, label: 'Buyer Name', if: proc { attributes[:user_id].blank? } do |order_item|
25
+ (order_item[:buyer_name] || '').split('!!SEP!!').find(&:present?)
26
+ end
25
27
  end
26
- end
27
28
 
28
- table_column :purchase_state, column: 'orders.purchase_state', filter: { type: :select, values: [%w(abandoned abandoned), [EffectiveOrders::PURCHASED, EffectiveOrders::PURCHASED], [EffectiveOrders::DECLINED, EffectiveOrders::DECLINED]], selected: EffectiveOrders::PURCHASED } do |order_item|
29
- order_item[:purchase_state] || 'abandoned'
30
- end
29
+ table_column :purchase_state, column: 'orders.purchase_state', filter: { type: :select, values: [%w(abandoned abandoned), [EffectiveOrders::PURCHASED, EffectiveOrders::PURCHASED], [EffectiveOrders::DECLINED, EffectiveOrders::DECLINED]], selected: EffectiveOrders::PURCHASED } do |order_item|
30
+ order_item[:purchase_state] || 'abandoned'
31
+ end
31
32
 
32
- table_column :title do |order_item|
33
- order_item.quantity == 1 ? order_item.title : "#{order_item.title} (#{order_item.quantity} purchased)"
34
- end
33
+ table_column :title do |order_item|
34
+ order_item.quantity == 1 ? order_item.title : "#{order_item.title} (#{order_item.quantity} purchased)"
35
+ end
35
36
 
36
- table_column(:subtotal) { |order_item| price_to_currency(order_item[:subtotal].to_i) }
37
- table_column(:tax) { |order_item| price_to_currency(order_item[:tax].to_i) }
38
- table_column(:total) { |order_item| price_to_currency(order_item[:total].to_i) }
37
+ table_column(:subtotal) { |order_item| price_to_currency(order_item[:subtotal].to_i) }
38
+ table_column(:tax) { |order_item| price_to_currency(order_item[:tax].to_i) }
39
+ table_column(:total) { |order_item| price_to_currency(order_item[:total].to_i) }
39
40
 
40
- table_column :created_at, :visible => false
41
- table_column :updated_at, :visible => false
41
+ table_column :created_at, :visible => false
42
+ table_column :updated_at, :visible => false
43
+ end
42
44
 
43
45
  def collection
44
46
  collection = Effective::OrderItem.unscoped
@@ -2,38 +2,40 @@ if defined?(EffectiveDatatables)
2
2
  module Effective
3
3
  module Datatables
4
4
  class Orders < Effective::Datatable
5
- default_order :purchased_at, :desc
5
+ datatable do
6
+ default_order :purchased_at, :desc
6
7
 
7
- table_column :purchased_at
8
- table_column :id
8
+ table_column :purchased_at
9
+ table_column :id
9
10
 
10
- table_column :email, column: 'users.email', label: 'Buyer Email', if: proc { attributes[:user_id].blank? } do |order|
11
- link_to order[:email], (edit_admin_user_path(order.user_id) rescue admin_user_path(order.user_id) rescue '#')
12
- end
11
+ table_column :email, column: 'users.email', label: 'Buyer Email', if: proc { attributes[:user_id].blank? } do |order|
12
+ link_to order[:email], (edit_admin_user_path(order.user_id) rescue admin_user_path(order.user_id) rescue '#')
13
+ end
13
14
 
14
- if EffectiveOrders.require_billing_address
15
- table_column :buyer_name, sortable: false, label: 'Buyer Name', if: proc { attributes[:user_id].blank? } do |order|
16
- (order[:buyer_name] || '').split('!!SEP!!').find(&:present?)
15
+ if EffectiveOrders.require_billing_address
16
+ table_column :buyer_name, sortable: false, label: 'Buyer Name', if: proc { attributes[:user_id].blank? } do |order|
17
+ (order[:buyer_name] || '').split('!!SEP!!').find(&:present?)
18
+ end
17
19
  end
18
- end
19
20
 
20
- table_column :purchase_state, filter: { type: :select, values: [%w(abandoned abandoned), [EffectiveOrders::PURCHASED, EffectiveOrders::PURCHASED], [EffectiveOrders::DECLINED, EffectiveOrders::DECLINED]], selected: EffectiveOrders::PURCHASED } do |order|
21
- order.purchase_state || 'abandoned'
22
- end
21
+ table_column :purchase_state, filter: { type: :select, values: [%w(abandoned abandoned), [EffectiveOrders::PURCHASED, EffectiveOrders::PURCHASED], [EffectiveOrders::DECLINED, EffectiveOrders::DECLINED]], selected: EffectiveOrders::PURCHASED } do |order|
22
+ order.purchase_state || 'abandoned'
23
+ end
23
24
 
24
- table_column :order_items, sortable: false, column: 'order_items.title' do |order|
25
- content_tag(:ul) do
26
- (order[:order_items] || '').split('!!SEP!!').map { |oi| content_tag(:li, oi) }.join.html_safe
25
+ table_column :order_items, sortable: false, column: 'order_items.title' do |order|
26
+ content_tag(:ul) do
27
+ (order[:order_items] || '').split('!!SEP!!').map { |oi| content_tag(:li, oi) }.join.html_safe
28
+ end
27
29
  end
28
- end
29
30
 
30
- table_column(:total) { |order| price_to_currency(order[:total].to_i) }
31
+ table_column(:total) { |order| price_to_currency(order[:total].to_i) }
31
32
 
32
- table_column :created_at, :visible => false
33
- table_column :updated_at, :visible => false
33
+ table_column :created_at, :visible => false
34
+ table_column :updated_at, :visible => false
34
35
 
35
- table_column :actions, sortable: false, filter: false do |order|
36
- link_to('View', (datatables_admin_path? ? effective_orders.admin_order_path(order) : effective_orders.order_path(order)))
36
+ table_column :actions, sortable: false, filter: false do |order|
37
+ link_to('View', (datatables_admin_path? ? effective_orders.admin_order_path(order) : effective_orders.order_path(order)))
38
+ end
37
39
  end
38
40
 
39
41
  def collection
@@ -1,3 +1,3 @@
1
1
  module EffectiveOrders
2
- VERSION = '1.3.12'.freeze
2
+ VERSION = '1.3.13'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_orders
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.12
4
+ version: 1.3.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-22 00:00:00.000000000 Z
11
+ date: 2015-07-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -128,14 +128,14 @@ dependencies:
128
128
  requirements:
129
129
  - - ">="
130
130
  - !ruby/object:Gem::Version
131
- version: 1.3.0
131
+ version: 2.0.0
132
132
  type: :runtime
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
136
  - - ">="
137
137
  - !ruby/object:Gem::Version
138
- version: 1.3.0
138
+ version: 2.0.0
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: effective_obfuscation
141
141
  requirement: !ruby/object:Gem::Requirement