Class: ProactiveSupport::Mgmt::Notes

Inherits:
Object
  • Object
show all
Defined in:
lib/proactive_support/mgmt/notes.rb

Class Method Summary collapse

Class Method Details

.create(customer_id, user_id, title, options = {}) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/proactive_support/mgmt/notes.rb', line 5

def create(customer_id, user_id, title, options = {})
  ::ProactiveSupport::Note.new.tap do |n|
    n.customer_id = customer_id
    n.user_id = user_id
    n.title = title.to_str[0,255] # truncate to size of db column
    n.content = options[:content]
    n.level = options[:level] || ::ProactiveSupport::INFO
    n.tags = options[:tags]
    n.is_active = true
    n.save!
  end
end