Module: EffectiveOrders
- Defined in:
- lib/generators/effective_orders/upgrade_price_column_generator.rb,
lib/effective_orders.rb,
lib/effective_orders/engine.rb,
lib/effective_orders/version.rb,
lib/generators/effective_orders/install_generator.rb,
lib/generators/effective_orders/upgrade_from03x_generator.rb
Overview
bundle exec rails generate effective_orders:upgrade_price_column TABLE COLUMN
Defined Under Namespace
Modules: Generators
Classes: AlreadyDeclinedException, AlreadyPurchasedException, Engine, SoldOutException
Constant Summary
collapse
- PURCHASED =
'purchased'
- DECLINED =
'declined'
- VERSION =
'1.7.2'.freeze
Class Method Summary
collapse
Class Method Details
.authorized?(controller, action, resource) ⇒ Boolean
70
71
72
73
74
75
|
# File 'lib/effective_orders.rb', line 70
def self.authorized?(controller, action, resource)
if authorization_method.respond_to?(:call) || authorization_method.kind_of?(Symbol)
raise Effective::AccessDenied.new() unless (controller || self).instance_exec(controller, action, resource, &authorization_method)
end
true
end
|
.minimum_charge ⇒ Object
77
78
79
80
81
82
83
84
|
# File 'lib/effective_orders.rb', line 77
def self.minimum_charge
if @@minimum_charge.nil? || @@minimum_charge.kind_of?(Integer)
@@minimum_charge
else
ActiveSupport::Deprecation.warn('EffectiveOrders.minimum_charge config option is a non-integer. It should be an Integer representing the number of cents. Continuing with (price * 100.0).round(0).to_i conversion') unless EffectiveOrders.silence_deprecation_warnings
((@@minimum_charge * 100.0).round(0).to_i rescue nil)
end
end
|
.setup {|_self| ... } ⇒ Object
66
67
68
|
# File 'lib/effective_orders.rb', line 66
def self.setup
yield self
end
|
.single_payment_processor? ⇒ Boolean
90
91
92
|
# File 'lib/effective_orders.rb', line 90
def self.single_payment_processor?
[moneris_enabled, paypal_enabled, stripe_enabled].select { |enabled| enabled }.length == 1
end
|
.use_active_admin? ⇒ Boolean
86
87
88
|
# File 'lib/effective_orders.rb', line 86
def self.use_active_admin?
use_active_admin && defined?(ActiveAdmin)
end
|