Sha256: be77da52f4d5d5ade22d9acd1c7686ca66c04d7a44a278c90b4357747dcabf3d

Contents?: true

Size: 317 Bytes

Versions: 3

Compression:

Stored size: 317 Bytes

Contents

module Economy
  class Exchange < ActiveRecord::Base

    after_commit :cache, on: :create

    validates_presence_of :service, :from, :to, :rate
    validates_length_of :from, :to, is: 3
    validates_numericality_of :rate, greater_than: 0

    private

    def cache
      Economy.cache.set self
    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
economy-4.0.1.0 lib/economy/exchange.rb
economy-4.0.0.0 lib/economy/exchange.rb
economy-0.0.1 lib/economy/exchange.rb