Class: Logistics::Core::ReviewNote

Inherits:
ApplicationRecord show all
Defined in:
app/models/logistics/core/review_note.rb

Instance Method Summary collapse

Methods inherited from ApplicationRecord

as_json

Instance Method Details

#change_to_hash(items) ⇒ Object



15
16
17
18
19
20
21
# File 'app/models/logistics/core/review_note.rb', line 15

def change_to_hash(items)
  data = []
  items.each { |item|
    data.push item.to_json
  }
  return data
end

#to_jsonObject



6
7
8
9
10
11
12
13
# File 'app/models/logistics/core/review_note.rb', line 6

def to_json
  JSON.parse(
      Jbuilder.encode do |json|
        json.id self.id
        json.note self.note
      end
  )
end