Sha256: dc68c63e98f827eef90c11be66b2a6b5faf9438f7183d693baa9c31a9f3b968f

Contents?: true

Size: 423 Bytes

Versions: 1

Compression:

Stored size: 423 Bytes

Contents

module Underworld
  module Concerns
    # This **concern** provide the default query loading scope for model.
    # Using this, you can make queries like key=value in http request
    # and  Model.assignment(key: value) on you model.
    module Assignment

      def self.included(base)
        base.scope :assignment_query, ->(field, value) do
          base.where(field => value)
        end
      end

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
underworld-1.0.0 app/models/underworld/concerns/assignment.rb