effective_orders 3.1.3 → 3.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 95a8ee70cdfec1d0abf23bd3a3d983f9ac6d853a6e795464bcd77bae043799d4
|
4
|
+
data.tar.gz: 4465d2da717814cdb4de4ca1efc6d606c57e41e034dfe8299aedf9ea93ca1ed3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 738feb98567d85fc601d721e79ba2c06d223d69252287623cca17c4540c362b514bb535000980c3421f30e9c792b40514550eeee5c53a486efb8f02bc8c8054e
|
7
|
+
data.tar.gz: cca56bc31234719b1ddb3f61721e98ce2ceca177e48eeb812305b270222f8b9f4e5fbc54ac1c24b0fec7166b81b7f12371ee563ab2e36a804330cb933b17d9d6
|
data/README.md
CHANGED
@@ -512,7 +512,7 @@ The `acts_as_purchasable` `.purchased?` and `.purchased_by?(user)` methods only
|
|
512
512
|
To programatically purchase one or more `acts_as_purchasable` objects:
|
513
513
|
|
514
514
|
```ruby
|
515
|
-
Effective::Order.new(@product1, @product2, user: current_user).purchase!(details: 'from my rake task')
|
515
|
+
Effective::Order.new(items: [@product1, @product2], user: current_user).purchase!(details: 'from my rake task')
|
516
516
|
```
|
517
517
|
|
518
518
|
Here the `billing_address` and `shipping_address` are copied from the `current_user` object if the `current_user` responds_to `billing_address` / `shipping_address` as per [effective_addresses](https://github.com/code-and-effect/effective_addresses/).
|
@@ -541,7 +541,7 @@ The one gotcha with the above two scenarios, is that when `purchase!` is called,
|
|
541
541
|
You can skip validations with the following command, but be careful as this skips all validations:
|
542
542
|
|
543
543
|
```ruby
|
544
|
-
Effective::Order.new(@product, user: @user).purchase!(validate: false)
|
544
|
+
Effective::Order.new(item: @product, user: @user).purchase!(validate: false)
|
545
545
|
```
|
546
546
|
|
547
547
|
The `@product` is now considered purchased.
|
@@ -24,7 +24,7 @@ module Effective
|
|
24
24
|
|
25
25
|
# This is the entry point for any Checkout button
|
26
26
|
def new
|
27
|
-
@order ||= Effective::Order.new(current_cart, user: current_user)
|
27
|
+
@order ||= Effective::Order.new(item: current_cart, user: current_user)
|
28
28
|
|
29
29
|
EffectiveOrders.authorize!(self, :new, @order)
|
30
30
|
|
@@ -48,7 +48,7 @@ module Effective
|
|
48
48
|
end
|
49
49
|
|
50
50
|
def create
|
51
|
-
@order ||= Effective::Order.new(current_cart, user: current_user)
|
51
|
+
@order ||= Effective::Order.new(item: current_cart, user: current_user)
|
52
52
|
EffectiveOrders.authorize!(self, :create, @order)
|
53
53
|
|
54
54
|
@order.assign_attributes(checkout_params) if params[:effective_order]
|
@@ -127,7 +127,7 @@ module EffectiveCartsHelper
|
|
127
127
|
end
|
128
128
|
|
129
129
|
def render_purchasables(*purchasables)
|
130
|
-
render(partial: 'effective/orders/order_items', locals: { order: Effective::Order.new(purchasables) })
|
130
|
+
render(partial: 'effective/orders/order_items', locals: { order: Effective::Order.new(items: purchasables) })
|
131
131
|
end
|
132
132
|
|
133
133
|
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: 3.1.
|
4
|
+
version: 3.1.4
|
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: 2019-08-
|
11
|
+
date: 2019-08-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|