effective_orders 1.5.5 → 1.5.7

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: 4c35da0558303f282bbfbfcb20c376fa2c2d5a31
4
- data.tar.gz: 69dad29645d72609176efe6efc6895ecee34ed75
3
+ metadata.gz: 75b721d5cabea376b54181ca7287d4e33ac3cdb3
4
+ data.tar.gz: 5f3601dc3f0b485dcbceef6554f2c262814568f1
5
5
  SHA512:
6
- metadata.gz: f0bc9242bb237594aa22f088063e26b3fdd3065ba8a8ad145465c561eda6143a9952304fbb0da55c1b1ea40545bb5e44ec7b798262e288c457749d3277a1f493
7
- data.tar.gz: b18ed09bc2179b7f89cca163c162eab5d9fc619d12a3b3cfec915774d84599234dc7458501bedbdb7642f4247537d94146b1f7089504e2e6fa209ac3cc4af45c
6
+ metadata.gz: 67bf705408eeef41f9b756737eb74fd900f6cd8c0e6fcab331e963756c74bb3de996fa7fc9794f6ce6e6e5cc68822e3fefae2328f7e31f18d1dfc0ceb3881be5
7
+ data.tar.gz: eae01bfd78dcdc3407305f6466a68994dd7412060d67a6bddbd60cc82d94dc744142c38fd4f25b4ce1c11e9e948819d10359f02b785a650c36ed199a54daf9a3
@@ -1,5 +1,5 @@
1
1
  hideShippingAddressFields = (shipping_address) ->
2
- shipping_address.hide().find('input,select').removeProp('required')
2
+ shipping_address.hide().find('input,select').removeAttr('required')
3
3
 
4
4
  showShippingAddressFields = (shipping_address) ->
5
5
  shipping_address.show().find("input:not([name$='[address2]']),select:not([name$='[state_code]'])").prop('required', true)
@@ -3,7 +3,7 @@ stripeCheckoutHandler = (key, form) ->
3
3
  key: key
4
4
  token: (token, args) ->
5
5
  if token.error
6
- form.find("input[type='submit']").removeProp('disabled')
6
+ form.find("input[type='submit']").removeAttr('disabled')
7
7
  $('input[data-disable-with]').each -> try $.rails.enableFormElement($(this))
8
8
 
9
9
  alert("An error ocurred when contacting Stripe. Your card has not been charged. Please refresh the page and try again. #{token.error.message}")
@@ -30,5 +30,5 @@ $(document).on 'click', "#effective-orders-new-charge-form form input[type='subm
30
30
  description: obj.data('description')
31
31
  amount: obj.data('amount')
32
32
  closed: ->
33
- form.find("input[type='submit']").removeProp('disabled')
33
+ form.find("input[type='submit']").removeAttr('disabled')
34
34
  $('input[data-disable-with]').each -> try $.rails.enableFormElement($(this))
@@ -3,7 +3,7 @@ stripeCheckoutHandler = (key, form) ->
3
3
  key: key
4
4
  token: (token, args) ->
5
5
  if token.error
6
- form.find("input[type='submit']").removeProp('disabled')
6
+ form.find("input[type='submit']").removeAttr('disabled')
7
7
  alert("An error ocurred when contacting Stripe. Your card has not been charged. Please refresh the page and try again. #{token.error.message}")
8
8
  else
9
9
  form.find("input[type='submit']").prop('disabled', true)
@@ -25,4 +25,4 @@ $(document).on 'click', "#effective-orders-new-subscription-form form input[type
25
25
  email: obj.data('user-email')
26
26
  description: plan.text()
27
27
  panelLabel: 'Start Subscription'
28
- closed: -> form.find("input[type='submit']").removeProp('disabled')
28
+ closed: -> form.find("input[type='submit']").removeAttr('disabled')
@@ -22,9 +22,9 @@ if defined?(EffectiveDatatables)
22
22
  order.purchase_state || 'abandoned'
23
23
  end
24
24
 
25
- table_column :order_items, sortable: false, column: 'order_items.title' do |order|
25
+ table_column :items, label: 'Order Items', sortable: false, column: query_items_list do |order|
26
26
  content_tag(:ul) do
27
- (order[:order_items] || '').split('!!SEP!!').map { |oi| content_tag(:li, oi) }.join.html_safe
27
+ (order[:items] || '').split('!!SEP!!').map { |oi| content_tag(:li, oi) }.join.html_safe
28
28
  end
29
29
  end
30
30
 
@@ -45,7 +45,7 @@ if defined?(EffectiveDatatables)
45
45
  .group('users.email, orders.id')
46
46
  .select('orders.*, users.email AS email')
47
47
  .select("#{query_total} AS total")
48
- .select("string_agg(order_items.title, '!!SEP!!') AS order_items")
48
+ .select("#{query_items_list} AS items")
49
49
  .select("#{query_payment_method} AS payment_method")
50
50
 
51
51
  if EffectiveOrders.require_billing_address && defined?(EffectiveAddresses)
@@ -72,6 +72,10 @@ if defined?(EffectiveDatatables)
72
72
  'SUM((order_items.price * order_items.quantity) + (CASE order_items.tax_exempt WHEN true THEN 0 ELSE ((order_items.price * order_items.quantity) * order_items.tax_rate) END))'
73
73
  end
74
74
 
75
+ def query_items_list
76
+ "string_agg(order_items.title, '!!SEP!!')"
77
+ end
78
+
75
79
  def query_payment_method
76
80
  "COALESCE(SUBSTRING(payment FROM 'card: (\\w{1,2})\\n'), SUBSTRING(payment FROM 'action: (\\w+)_postback\\n'))"
77
81
  end
@@ -86,6 +90,8 @@ if defined?(EffectiveDatatables)
86
90
  then collection.having("#{query_total} = ?", (search_term.gsub(/[^0-9.]/, '').to_f * 100.0).to_i)
87
91
  when 'purchase_state'
88
92
  then search_term == 'abandoned' ? collection.where(purchase_state: nil) : super
93
+ when 'items'
94
+ then collection.having("#{query_items_list} ILIKE ?", "%#{search_term}%")
89
95
  when 'payment_method'
90
96
  then collection.having("#{query_payment_method} LIKE ?", "#{search_term}%")
91
97
  else
@@ -1,3 +1,3 @@
1
1
  module EffectiveOrders
2
- VERSION = '1.5.5'.freeze
2
+ VERSION = '1.5.7'.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.5.5
4
+ version: 1.5.7
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-11-02 00:00:00.000000000 Z
11
+ date: 2015-11-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -114,14 +114,14 @@ dependencies:
114
114
  requirements:
115
115
  - - ">="
116
116
  - !ruby/object:Gem::Version
117
- version: 1.1.0
117
+ version: 1.3.6
118
118
  type: :runtime
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - ">="
123
123
  - !ruby/object:Gem::Version
124
- version: 1.1.0
124
+ version: 1.3.6
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: effective_obfuscation
127
127
  requirement: !ruby/object:Gem::Requirement