module CategorySearch

Public Class Methods

Public Instance Methods

as_indexed_json(options={}) click to toggle source

This will return all the relevant rows from the database.

# File app/models/concerns/category_search.rb, line 21
def as_indexed_json(options={})
        {
                id: id,
                name: name,

                tutors: tutors.map { |t|
                        {
                                _type: 'tutor',
                                _id: t.id,
                                name: t.name
                        }
                }
        }
end
as_json(option={}) click to toggle source

Calls Superclass Method

Calls superclass method
# File app/models/concerns/category_search.rb, line 37
def as_json(option={})
        json = super(option)
        json[:_type] = 'category'
        json
end