Sha256: dce6ae86888927ab6477b39311dc9d4878a9f01e30cadfa76095ac84d5822df6
Contents?: true
Size: 564 Bytes
Versions: 2
Compression:
Stored size: 564 Bytes
Contents
class Iro::Stock include Mongoid::Document include Mongoid::Timestamps store_in collection: 'iro_stocks' STATUS_ACTIVE = 'active' STATUS_INACTIVE = 'inactive' STATUSES = [ nil, 'active', 'inactive' ] def self.active where( status: STATUS_ACTIVE ) end field :status field :ticker validates :ticker, uniqueness: true, presence: true field :last, type: :float def self.list end def self.tickers_list [nil] + all.map( &:ticker ) end # has_many :strategies, class_name: 'Iro::Strategy', inverse_of: :stock end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
iron_warbler-2.0.7.10 | app/models/iro/stock.rb |
iron_warbler-2.0.7.9 | app/models/iro/stock.rb |