survey/app/models/survey_pagination.rb

14 lines
334 B
Ruby
Raw Normal View History

2021-07-08 13:31:27 +00:00
class SurveyPagination
include Mongoid::Document
include Mongoid::Timestamps
field :index, type: Integer
field :start_section, type: Integer
field :end_section, type: Integer
belongs_to :questionnaire_survey
def as_json(**xargs)
res = super({except: :_id}.merge(xargs))
res.merge({_id: self.id.to_s})
end
end