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.3.10'.freeze
Class Method Summary
collapse
Class Method Details
.authorized?(controller, action, resource) ⇒ Boolean
62
63
64
65
66
67
|
# File 'lib/effective_orders.rb', line 62
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
69
70
71
72
73
74
75
76
|
# File 'lib/effective_orders.rb', line 69
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
58
59
60
|
# File 'lib/effective_orders.rb', line 58
def self.setup
yield self
end
|