Sha256: e1b22764a0c457ef094d49a2da4660d817ec6e7d5503e825b13cbb66777f643e

Contents?: true

Size: 500 Bytes

Versions: 45

Compression:

Stored size: 500 Bytes

Contents


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

  field :label,   type: :string
  field :message, type: :string

  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

45 entries across 45 versions & 1 rubygems

Version Path
wco_models-3.1.0.151 app/models/wco/log.rb
wco_models-3.1.0.150 app/models/wco/log.rb
wco_models-3.1.0.149 app/models/wco/log.rb
wco_models-3.1.0.148 app/models/wco/log.rb
wco_models-3.1.0.147 app/models/wco/log.rb
wco_models-3.1.0.146 app/models/wco/log.rb
wco_models-3.1.0.145 app/models/wco/log.rb
wco_models-3.1.0.144 app/models/wco/log.rb
wco_models-3.1.0.143 app/models/wco/log.rb
wco_models-3.1.0.142 app/models/wco/log.rb
wco_models-3.1.0.141 app/models/wco/log.rb
wco_models-3.1.0.140 app/models/wco/log.rb
wco_models-3.1.0.139 app/models/wco/log.rb
wco_models-3.1.0.138 app/models/wco/log.rb
wco_models-3.1.0.137 app/models/wco/log.rb
wco_models-3.1.0.136 app/models/wco/log.rb
wco_models-3.1.0.135 app/models/wco/log.rb
wco_models-3.1.0.134 app/models/wco/log.rb
wco_models-3.1.0.133 app/models/wco/log.rb
wco_models-3.1.0.132 app/models/wco/log.rb