Class: Array
- Inherits:
-
Object
- Object
- Array
- Defined in:
- lib/json_serializer/rails/active_record_patch.rb
Instance Method Summary collapse
Instance Method Details
#serialize ⇒ Object
16 17 18 |
# File 'lib/json_serializer/rails/active_record_patch.rb', line 16 def serialize self.collect{|model| model.send((model.respond_to? :api_attributes) ? :api_attributes : :to_json).merge({:_class_name => self.first.class.name.downcase.pluralize})}.group_by{|d| d[:_class_name] } end |