Class: Limit
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Limit
- Defined in:
- app/models/limit.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.for(payment, filter_amount = true) ⇒ Object
METHODS
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'app/models/limit.rb', line 58 def self.for(payment, filter_amount=true) limit = payment.provider.limits.actual.first return [] if limit.blank? rates = limit.limit_sections. by_terminal_profile_and_agent_ids(payment.terminal.terminal_profile_id, payment.terminal.agent_id). by_payment_type(payment.payment_type) rates.select!{|x| x.min <= payment.paid_amount && x.max >= payment.paid_amount } if filter_amount rates.sort_by(&:weight).reverse end |
Instance Method Details
#title ⇒ Object
74 75 76 |
# File 'app/models/limit.rb', line 74 def title "##{id}" end |