effective_orders 6.8.0 → 6.8.2

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
  SHA256:
3
- metadata.gz: f83eb44947b1c5f4f906f04822df9860f892727a02146f33e03eb468ffe65ea6
4
- data.tar.gz: 726acb095ff327c25c438eacaec1db6cfa551207582a4d82a7a677e809b5087f
3
+ metadata.gz: 3564d400d398b71b8799a81b8668ba35aee5e69e222d3849ff4903e94338de67
4
+ data.tar.gz: 9905c4d6d0364f2b0b30e5752de9809fb2fd765124ac61d9f2f79e7c753e6bd6
5
5
  SHA512:
6
- metadata.gz: 0cc47f00733d0927470036ec6d9d2ef434945204426692ac26858e64a88d0b38e3a57396f64d2c1980152a8924d174cbd014dde7cc4245c2e8bcdf1922f7eb22
7
- data.tar.gz: 3e6d4ee0aa861c39ec8f11e55879201908b3c6c62910e47631e69ab8662966eaef265e51906a8a954a806a7cec9020c13c6eb1123b26c11669d3c44137172cfc
6
+ metadata.gz: 6d7eba677128528f63a37143ada91e7c501aeb52a0a90715acf6615543e420309bfcf02df64e68cecdefe9847db022bdf2750cac8d4dcc2e046e61e78c6ee834
7
+ data.tar.gz: 3fa0dad90dc8ea85190b1f234f5ba717ba14520e1956468cfafa94e182ae253213e9dc181a15d7124733b18ea642d5af0c80893ea6fdc097c865d9524c2ce1e5
@@ -55,6 +55,10 @@ module Admin
55
55
  col :email, visible: false
56
56
  end
57
57
 
58
+ if attributes[:organization_id].blank?
59
+ col :organization
60
+ end
61
+
58
62
  col :parent, visible: false, search: :string
59
63
 
60
64
  col :cc, visible: false
@@ -111,10 +115,14 @@ module Admin
111
115
  user_klass = (attributes[:user_type].constantize if attributes[:user_type].present?)
112
116
  user_klass ||= current_user.class
113
117
 
114
- user = user_klass.find(attributes[:user_id])
118
+ user = user_klass.where(id: attributes[:user_id]).first!
115
119
  scope = scope.where(user: user)
116
120
  end
117
121
 
122
+ if attributes[:organization_id].present? && attributes[:organization_type].present?
123
+ scope = scope.where(organization_id: attributes[:organization_id], organization_type: attributes[:organization_type])
124
+ end
125
+
118
126
  if attributes[:parent_id].present? && attributes[:parent_type].present?
119
127
  scope = scope.where(parent_id: attributes[:parent_id], parent_type: attributes[:parent_type])
120
128
  end
@@ -1,3 +1,3 @@
1
1
  module EffectiveOrders
2
- VERSION = '6.8.0'.freeze
2
+ VERSION = '6.8.2'.freeze
3
3
  end
@@ -47,15 +47,7 @@ module EffectiveOrders
47
47
  end
48
48
 
49
49
  def create_migration_file
50
- @orders_table_name = ':' + EffectiveOrders.orders_table_name.to_s
51
- @order_items_table_name = ':' + EffectiveOrders.order_items_table_name.to_s
52
- @carts_table_name = ':' + EffectiveOrders.carts_table_name.to_s
53
- @cart_items_table_name = ':' + EffectiveOrders.cart_items_table_name.to_s
54
- @customers_table_name = ':' + EffectiveOrders.customers_table_name.to_s
55
- @subscriptions_table_name = ':' + EffectiveOrders.subscriptions_table_name.to_s
56
- @products_table_name = ':' + EffectiveOrders.products_table_name.to_s
57
-
58
- migration_template ('../' * 3) + 'db/migrate/01_create_effective_orders.rb.erb', 'db/migrate/create_effective_orders.rb'
50
+ migration_template ('../' * 3) + 'db/migrate/101_create_effective_orders.rb', 'db/migrate/create_effective_orders.rb'
59
51
  end
60
52
 
61
53
  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: 6.8.0
4
+ version: 6.8.2
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: 2023-08-24 00:00:00.000000000 Z
11
+ date: 2023-09-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails