Module: MongoidApiBase

Extended by:
ActiveSupport::Concern
Defined in:
lib/mongoid-api-base/concern.rb,
lib/mongoid-api-base/version.rb

Overview

MongoidApiBase Rails concern to implement API controllers for Mongoid models.


Usage Example:

include MongoidApiBase

defaults resource_class: Journal::JournalPost,
         per_page: 30

has_scope :by_category
has_scope :hidden,     type: :boolean
has_scope :not_hidden, type: :boolean

json_config methods: %w(hex slug sorted_categories opengraph_image_url meta_title meta_description),
            index: {
              except:  %w(body_markdown body_html),
              methods: %w(hex slug)
            }

Constant Summary collapse

RAILS_VERSION =
"~> 4.2.5.1"
VERSION =
"0.1.3"