effective_orders 3.1.3 → 3.1.4

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: 2a44d926ef3b5778ccedeb057cb96ed9d0df5e63642ef26851db9d4df4a4e0f7
4
- data.tar.gz: 222f7df06cf76aa2d39ab3c428744057eed9468f4838c6230612ac6bda81ed55
3
+ metadata.gz: 95a8ee70cdfec1d0abf23bd3a3d983f9ac6d853a6e795464bcd77bae043799d4
4
+ data.tar.gz: 4465d2da717814cdb4de4ca1efc6d606c57e41e034dfe8299aedf9ea93ca1ed3
5
5
  SHA512:
6
- metadata.gz: 3218139fa9780d82e159d83498e35589fbe99115b59e076b2cc1c27f033a1a6f7e91fbcc4eb9eb4d7161a6a28a1dbac3ecbaf42026f305d08a7aa986ddc95211
7
- data.tar.gz: 0c6b49680dac2b6f4044484f15ed197b32ce145433ff67171331896f0251cba6e4f8b1e2341fa2913a73fb5fd1278d65ee8f7a45ce7bda14dc65a028a6ed7e5d
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
@@ -1,3 +1,3 @@
1
1
  module EffectiveOrders
2
- VERSION = '3.1.3'.freeze
2
+ VERSION = '3.1.4'.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: 3.1.3
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-12 00:00:00.000000000 Z
11
+ date: 2019-08-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails