Sha256: c9e7111de95089a35386b6fb5fe91ccf53cc25de7785dfbdc61e1aa1ae444ff4

Contents?: true

Size: 425 Bytes

Versions: 8

Compression:

Stored size: 425 Bytes

Contents

class Money < ActiveRecord::Base
  
  belongs_to :currency
  before_save :parse_currency_code

  attr_accessor :currency_code

  private 
  
  def parse_currency_code
    unless currency_code.blank?
      case currency_code.downcase
        # Check for all iso currency types we support
        when "usd" then self.currency = Currency.usd
        # add additional currency types
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
erp_base_erp_svcs-3.0.7 app/models/money.rb
erp_base_erp_svcs-3.0.6 app/models/money.rb
erp_base_erp_svcs-3.0.5 app/models/money.rb
erp_base_erp_svcs-3.0.4 app/models/money.rb
erp_base_erp_svcs-3.0.3 app/models/money.rb
erp_base_erp_svcs-3.0.2 app/models/money.rb
erp_base_erp_svcs-3.0.1 app/models/money.rb
erp_base_erp_svcs-3.0.0 app/models/money.rb