Sha256: 57277f18227b99ac0dfb6545d30d6ced8962c1a293a44d70209c09f5c738265d

Contents?: true

Size: 558 Bytes

Versions: 28

Compression:

Stored size: 558 Bytes

Contents


class Wco::Log
  include Mongoid::Document
  include Mongoid::Timestamps
  include Mongoid::Paranoia
  store_in collection: 'wco_logs'

  field :label,   type: :string ## can be the stream: 'stdout' or 'stderr'
  field :message, type: :string ## can be json

  belongs_to :obj, polymorphic: true, optional: true

  has_and_belongs_to_many :tags

  def self.puts! message, label, obj: nil
    create( message: message, label: label, obj: obj )
    puts "+++ +++ #{label}:"
    puts message.inspect
  end

  def to_s
    "#{created_at} #{message}"
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
wco_models-3.1.0.187 app/models/wco/log.rb
wco_models-3.1.0.184 app/models/wco/log.rb
wco_models-3.1.0.183 app/models/wco/log.rb
wco_models-3.1.0.182 app/models/wco/log.rb
wco_models-3.1.0.181 app/models/wco/log.rb
wco_models-3.1.0.180 app/models/wco/log.rb
wco_models-3.1.0.178 app/models/wco/log.rb
wco_models-3.1.0.177 app/models/wco/log.rb
wco_models-3.1.0.176 app/models/wco/log.rb
wco_models-3.1.0.175 app/models/wco/log.rb
wco_models-3.1.0.174 app/models/wco/log.rb
wco_models-3.1.0.173 app/models/wco/log.rb
wco_models-3.1.0.172 app/models/wco/log.rb
wco_models-3.1.0.171 app/models/wco/log.rb
wco_models-3.1.0.170 app/models/wco/log.rb
wco_models-3.1.0.169 app/models/wco/log.rb
wco_models-3.1.0.168 app/models/wco/log.rb
wco_models-3.1.0.167 app/models/wco/log.rb
wco_models-3.1.0.166 app/models/wco/log.rb
wco_models-3.1.0.165 app/models/wco/log.rb