effective_orders 6.4.0 → 6.4.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: b6a326d583bd61702bc628143d2410df18b718a2664d0a890b770a080ac8b774
4
- data.tar.gz: 3db513a6b48f22781475e64004d4505e67276d7fdbb2e4c31e14e72db6a73038
3
+ metadata.gz: 90a19ed34f8da51170b8965ccfe0bcbfaf26fcbd93dfae012a8b11829cc80598
4
+ data.tar.gz: 9e9ac05750936bc695131008ea968e8686280f28671584ab5c7a9b9a5c805d56
5
5
  SHA512:
6
- metadata.gz: 03c9a070559a2cdd72f5fb035acaebfeaeffa453bdf05d45ef8fb0835babf72797304414cd0ea951ea16d209b16d2fd5432c85ff802ab7a1b209d9c3848021a7
7
- data.tar.gz: 0f46f551e66b659cf52deb9ddaa6d6f3eaeba4a37691b10001e01eefae4a3f120c949c3a4ed1818e70d058ea5d812ac6eda3b03af8df8bdf65f16f3f2dd54e6b
6
+ metadata.gz: f48d47e8a4c4c2786a5b6f4b0b88ff90bc0d62350c93d1a7424ffb7c40204ea9e53eb4757b10279c235174f201ffb7ec325ca447b31c5c7f4b715798b44ec43f
7
+ data.tar.gz: fbc376af786b0c282e0498bd023f33306a60cc1fd9e4139ddf71f63f6e84c9c325ee242faa9185e7574c58609b083144cc65c6b70b912a5e0e5be128c2481eee
@@ -104,6 +104,20 @@ module Effective
104
104
  EffectiveResources.authorize!(self, :show, @order)
105
105
  end
106
106
 
107
+ def send_buyer_receipt
108
+ @order = Effective::Order.purchased.find(params[:id])
109
+
110
+ EffectiveResources.authorize!(self, :show, @order)
111
+
112
+ if @order.send_order_receipt_to_buyer!
113
+ flash[:success] = "A receipt has been sent to #{@order.emails_send_to}"
114
+ else
115
+ flash[:danger] = "Unable to send receipt."
116
+ end
117
+
118
+ redirect_to effective_orders.order_path(@order)
119
+ end
120
+
107
121
  def bulk_send_buyer_receipt
108
122
  @orders = Effective::Order.purchased.where(id: params[:ids])
109
123
 
@@ -4,11 +4,13 @@ module EffectiveOrders
4
4
 
5
5
  # Include acts_as_addressable concern and allow any ActiveRecord object to call it
6
6
  initializer 'effective_orders.active_record' do |app|
7
- ActiveSupport.on_load :active_record do
8
- ActiveRecord::Base.extend(ActsAsPurchasable::Base)
9
- ActiveRecord::Base.extend(ActsAsPurchasableParent::Base)
10
- ActiveRecord::Base.extend(ActsAsSubscribable::Base)
11
- ActiveRecord::Base.extend(ActsAsSubscribableBuyer::Base)
7
+ app.config.to_prepare do
8
+ ActiveSupport.on_load :active_record do
9
+ ActiveRecord::Base.extend(ActsAsPurchasable::Base)
10
+ ActiveRecord::Base.extend(ActsAsPurchasableParent::Base)
11
+ ActiveRecord::Base.extend(ActsAsSubscribable::Base)
12
+ ActiveRecord::Base.extend(ActsAsSubscribableBuyer::Base)
13
+ end
12
14
  end
13
15
  end
14
16
 
@@ -1,3 +1,3 @@
1
1
  module EffectiveOrders
2
- VERSION = '6.4.0'.freeze
2
+ VERSION = '6.4.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: 6.4.0
4
+ version: 6.4.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-04-27 00:00:00.000000000 Z
11
+ date: 2023-05-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails