module Logistics module Core class ReviewNote < ApplicationRecord belongs_to :correspondence, polymorphic: true def to_json JSON.parse( Jbuilder.encode do |json| json.id self.id json.note self.note end ) end def change_to_hash(items) data = [] items.each { |item| data.push item.to_json } return data end end end end