Sha256: 00977b2cfd279e8ba8fde6c0b584cede31793bbb84f366b25377f94aec2eb2ab

Contents?: true

Size: 461 Bytes

Versions: 1

Compression:

Stored size: 461 Bytes

Contents

module DoorkeeperMongodb
  module Mixins
    module Mongoid
      module BaseMixin
        extend ActiveSupport::Concern

        module ClassMethods
          def ordered_by(attribute, direction = :asc)
            order_by(attribute => direction.to_sym)
          end
        end

        def as_json(*args)
          json_response = super

          json_response["id"] = json_response["_id"]

          json_response
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
doorkeeper-mongodb-5.0.0 lib/doorkeeper-mongodb/mixins/mongoid/base_mixin.rb