effective_orders 4.3.1 → 4.3.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: b0a7fe7dc66dd81db05828a4dc7fcc67211ad1956d3271b60a998f7a69c1da1c
4
- data.tar.gz: 73c4bada545b7698e54434976dff5f308d3cfc27ac849857dd1a9b4b9e9392eb
3
+ metadata.gz: cbc56753acb82a9f43d3c6cd058e4351cf54ee58d4df9fad0f266bb88d40af19
4
+ data.tar.gz: 4537fe9ccd27a6aeb1d659bedbe620e8e85d17f78f76609396c5fb05a4e79dc8
5
5
  SHA512:
6
- metadata.gz: 4da869ec7f1ddec5dc4537a94fe3e110715d3a2de6665e03d2d994be76dc1661fe7e21f71cd1f47d57140e712ebbc5917eba7963c0f976aa1be9a34a809852ef
7
- data.tar.gz: 5514e1b253e652fa2657d60c6afc0abf0dce6dce777a0605a20b732aee8e5856ce09cfafece85c5228c9d873bd3016c22e322a04021204340364e0f7bd2b549e
6
+ metadata.gz: 46733ccd15b8de247c865c88df956deb0e66234ca614aab1db0b79e60fade92c7b18c98b06ab508e6776d55cbf83c9dae6c7bf17b6598747f8739d019b17e382
7
+ data.tar.gz: bb9b03c81ed435ffd7dfe7320c975f0d76d86e45ec6e149b0667e6094107505cb0e9abcbefaa9cb8e2af3707e77aa29b1a2b1466dfc65dbc8fc5cc1ade3f8f81
@@ -4,10 +4,6 @@ module Admin
4
4
 
5
5
  layout (EffectiveOrders.layout.kind_of?(Hash) ? EffectiveOrders.layout[:admin_orders] : EffectiveOrders.layout)
6
6
 
7
- # def effective_resource
8
- # @_effective_resource ||= Effective::Resource.new('effective/order', namespace: :admin)
9
- # end
10
-
11
7
  def new
12
8
  @order = Effective::Order.new
13
9
 
@@ -89,7 +89,11 @@ class EffectiveOrdersDatatable < Effective::Datatable
89
89
  scope = EffectiveOrders.orders_collection_scope.call(scope)
90
90
  end
91
91
 
92
- attributes[:user_id].present? ? scope.where(user_id: attributes[:user_id]) : scope
92
+ if attributes[:user_id].present?
93
+ scope = scope.where(user_id: attributes[:user_id])
94
+ end
95
+
96
+ scope
93
97
  end
94
98
 
95
99
  end
@@ -29,7 +29,7 @@ module Effective
29
29
  attr_accessor :skip_buyer_validations # Set by Admin::Orders#create
30
30
 
31
31
  belongs_to :user, validate: false # This is the buyer/user of the order. We validate it below.
32
- has_many :order_items, -> { order(:id) }, inverse_of: :order, class_name: 'Effective::OrderItem'
32
+ has_many :order_items, -> { order(:id) }, inverse_of: :order, class_name: 'Effective::OrderItem', dependent: :delete_all
33
33
 
34
34
  accepts_nested_attributes_for :order_items, allow_destroy: false, reject_if: :all_blank
35
35
  accepts_nested_attributes_for :user, allow_destroy: false, update_only: true
@@ -1,3 +1,3 @@
1
1
  module EffectiveOrders
2
- VERSION = '4.3.1'.freeze
2
+ VERSION = '4.3.2'.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: 4.3.1
4
+ version: 4.3.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: 2020-04-09 00:00:00.000000000 Z
11
+ date: 2020-04-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails