Module: Noticed::Model::ClassMethods

Defined in:
lib/noticed/model.rb

Instance Method Summary collapse

Instance Method Details

#mark_as_read!Object



18
19
20
# File 'lib/noticed/model.rb', line 18

def mark_as_read!
  update_all(read_at: Time.current, updated_at: Time.current)
end

#noticed_coderObject



22
23
24
25
26
27
28
29
# File 'lib/noticed/model.rb', line 22

def noticed_coder
  case attribute_types["params"].type
  when :json, :jsonb
    Noticed::Coder
  else
    Noticed::TextCoder
  end
end