Sha256: d19f15824e68875016dcce8c2a35777e0630c70459c8832128caa6cca4ab802a

Contents?: true

Size: 320 Bytes

Versions: 4

Compression:

Stored size: 320 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.update self
    end

  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
economy-5.1.0 lib/economy/exchange.rb
economy-4.0.2.2 lib/economy/exchange.rb
economy-4.0.2.1 lib/economy/exchange.rb
economy-4.0.2.0 lib/economy/exchange.rb