effective_orders 1.5.0 → 1.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/concerns/acts_as_active_admin_controller.rb +7 -7
- data/app/controllers/effective/providers/paypal.rb +1 -1
- data/app/controllers/effective/providers/stripe.rb +1 -1
- data/lib/effective_orders/engine.rb +7 -7
- data/lib/effective_orders/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c1cf9baa9d485752d3758cd486c22451656851a9
|
4
|
+
data.tar.gz: c4e7fae35b93f72319b7b525382c085272c8f016
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 406fb85de09e76af4dcbd5c3ef92d911f587a8bbdce2cefeb5f095ccf2f1e1341e2e7b716a21b4106c06baff89a5285281fcd407b4e381512acaa9c3ff2add5c
|
7
|
+
data.tar.gz: dbff00b400518808d5071d166c8246a673fda871a71304e5ad16726e7402c355e77389a4965bc363b4cbc81715261c1efd9dc1cb6ea1887a1dbe50071f9e6d8b
|
@@ -2,17 +2,17 @@ module ActsAsActiveAdminController
|
|
2
2
|
extend ActiveSupport::Concern
|
3
3
|
|
4
4
|
module ActionController
|
5
|
-
def acts_as_active_admin_controller(
|
6
|
-
@active_admin_resource_element_lookup_key =
|
5
|
+
def acts_as_active_admin_controller(element_lookup_key)
|
6
|
+
@active_admin_resource_element_lookup_key = element_lookup_key
|
7
7
|
include ::ActsAsActiveAdminController
|
8
8
|
end
|
9
9
|
end
|
10
10
|
|
11
11
|
included do
|
12
|
-
include
|
13
|
-
include
|
12
|
+
include ActiveAdmin::BaseController::Menu
|
13
|
+
include ActiveAdmin::BaseController::Authorization
|
14
14
|
|
15
|
-
helper
|
15
|
+
helper ActiveAdmin::ViewHelpers
|
16
16
|
helper_method :active_admin_config, :active_admin_namespace, :current_active_admin_user
|
17
17
|
|
18
18
|
resource_key = @active_admin_resource_element_lookup_key.to_s
|
@@ -36,7 +36,7 @@ module ActsAsActiveAdminController
|
|
36
36
|
end
|
37
37
|
|
38
38
|
def active_admin_namespace
|
39
|
-
|
39
|
+
ActiveAdmin.application.namespaces[EffectiveOrders.active_admin_namespace || :root]
|
40
40
|
end
|
41
41
|
|
42
42
|
def active_admin_config
|
@@ -45,7 +45,7 @@ module ActsAsActiveAdminController
|
|
45
45
|
|
46
46
|
def active_admin_resource_key
|
47
47
|
@active_admin_resource_key ||= begin
|
48
|
-
namespace =
|
48
|
+
namespace = ActiveAdmin.application.namespaces[EffectiveOrders.active_admin_namespace || :root]
|
49
49
|
namespace.resources.keys.find { |resource| resource.element == active_admin_resource_element_key }
|
50
50
|
end
|
51
51
|
end
|
@@ -9,7 +9,7 @@ module Effective
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def stripe_charge
|
12
|
-
@order
|
12
|
+
@order ||= Effective::Order.find(stripe_charge_params[:effective_order_id])
|
13
13
|
@stripe_charge = Effective::StripeCharge.new(stripe_charge_params)
|
14
14
|
@stripe_charge.order = @order
|
15
15
|
|
@@ -7,10 +7,6 @@ module EffectiveOrders
|
|
7
7
|
# Include Helpers to base application
|
8
8
|
initializer 'effective_orders.action_controller' do |app|
|
9
9
|
ActiveSupport.on_load :action_controller do
|
10
|
-
if EffectiveOrders.use_active_admin
|
11
|
-
ActionController::Base.extend(ActsAsActiveAdminController::ActionController)
|
12
|
-
end
|
13
|
-
|
14
10
|
helper EffectiveOrdersHelper
|
15
11
|
helper EffectiveCartsHelper
|
16
12
|
helper EffectivePaypalHelper if EffectiveOrders.paypal_enabled
|
@@ -44,12 +40,16 @@ module EffectiveOrders
|
|
44
40
|
end
|
45
41
|
end
|
46
42
|
|
47
|
-
# ActiveAdmin (optional)
|
48
|
-
# This prepends the load path so someone can override the assets.rb if they want.
|
43
|
+
# Use ActiveAdmin (optional)
|
49
44
|
initializer 'effective_orders.active_admin' do
|
50
45
|
if EffectiveOrders.use_active_admin
|
51
46
|
require 'activeadmin'
|
52
|
-
|
47
|
+
|
48
|
+
ActiveSupport.on_load :action_controller do
|
49
|
+
ApplicationController.extend(ActsAsActiveAdminController::ActionController)
|
50
|
+
end
|
51
|
+
|
52
|
+
ActiveAdmin.application.load_paths.unshift Dir["#{config.root}/active_admin"]
|
53
53
|
end
|
54
54
|
end
|
55
55
|
|
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: 1.5.
|
4
|
+
version: 1.5.1
|
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: 2015-10-
|
11
|
+
date: 2015-10-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|