app/models/iro/stock.rb in iron_warbler-2.0.7.22 vs app/models/iro/stock.rb in iron_warbler-2.0.7.23
- old
+ new
@@ -1,9 +1,10 @@
class Iro::Stock
include Mongoid::Document
include Mongoid::Timestamps
+ include Mongoid::Paranoia
store_in collection: 'iro_stocks'
STATUS_ACTIVE = 'active'
STATUS_INACTIVE = 'inactive'
STATUSES = [ nil, 'active', 'inactive' ]
@@ -15,12 +16,14 @@
field :ticker
validates :ticker, uniqueness: true, presence: true
index({ ticker: -1 }, { unique: true })
field :last, type: :float
+ field :options_price_increment, type: :float
has_many :positions, class_name: 'Iro::Position', inverse_of: :stock
has_many :strategies, class_name: 'Iro::Strategy', inverse_of: :stock
+ has_many :purses, class_name: 'Iro::Purse', inverse_of: :stock
def to_s
ticker
end
def self.list