Sha256: 85036994fe36762f93db8e8c7b3f97c6a65bbc81dd83f7ec1a7e0cc12f513a00

Contents?: true

Size: 752 Bytes

Versions: 34

Compression:

Stored size: 752 Bytes

Contents

class Office::Action
  include Mongoid::Document
  include Mongoid::Timestamps
  store_in collection: 'office_actions'

  field :slug, type: :string
  validates :slug, uniqueness: true, allow_nil: true

  field :descr, type: :string ## optional


  STATE_ACTIVE   = 'active'
  STATE_INACTIVE = 'inactive'
  STATES         = [ STATE_ACTIVE, STATE_INACTIVE ]
  field :state, type: :string
  scope :active, ->{ where( state: STATE_ACTIVE ) }


  has_many :ties,      class_name: '::Office::ActionTie', inverse_of: :office_action
  has_many :prev_ties, class_name: '::Office::ActionTie', inverse_of: :next_office_action
  accepts_nested_attributes_for :ties

  field :action_exe, type: :string

  field :perform_at, type: :time

end
OAct = Office::Action

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
ish_models-0.0.33.249 lib/office/action.rb
ish_models-0.0.33.248 lib/office/action.rb
ish_models-0.0.33.247 lib/office/action.rb
ish_models-0.0.33.246 lib/office/action.rb
ish_models-0.0.33.245 lib/office/action.rb
ish_models-0.0.33.244 lib/office/action.rb
ish_models-0.0.33.243 lib/office/action.rb
ish_models-0.0.33.242 lib/office/action.rb
ish_models-0.0.33.241 lib/office/action.rb
ish_models-0.0.33.240 lib/office/action.rb
ish_models-0.0.33.239 lib/office/action.rb
ish_models-0.0.33.238 lib/office/action.rb
ish_models-0.0.33.237 lib/office/action.rb
ish_models-0.0.33.236 lib/office/action.rb