Module: InspectorDragit::ActiveRecord::Include

Defined in:
lib/inspector_dragit/active_record.rb

Instance Method Summary collapse

Instance Method Details

#inspector_dragit_dataObject



14
15
16
17
18
19
20
21
22
# File 'lib/inspector_dragit/active_record.rb', line 14

def inspector_dragit_data
  id_data = {}
  id_data[:title] = inspector_dragit_template[:title]
  id_data[:attributes] = []
  inspector_dragit_template[:attributes].each do |a_hash|
    id_data[:attributes] << {:label => a_hash[:label], :value => self.send(a_hash[:attr]) }
  end
  id_data
end

#inspector_dragit_templateObject



10
11
12
# File 'lib/inspector_dragit/active_record.rb', line 10

def inspector_dragit_template
  self.class.respond_to?(:class_insp_dragit_template) ? self.class.class_insp_dragit_template : {:title => "", :attributes => []}
end