Module: Picklive::Currency::ModelMethods
- Defined in:
- lib/picklive/currency.rb
Overview
It provides scopes for models that have a ‘currency_code` method.
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.included(base) ⇒ Object
135 136 137 138 139 140 141 142 |
# File 'lib/picklive/currency.rb', line 135 def self.included(base) if defined?(ActiveRecord::Base) && base.superclass == ActiveRecord::Base base.class_eval do scope :cash_only, where(:currency_code => Picklive::Currency.cash_codes) scope :virtual_only, where(:currency_code => Picklive::Currency.virtual_codes) end end end |