Sha256: 7d9651fe973a64dab1a543726f4c38ab1a1716e84b76d13ed1c8dab1eeb86e90

Contents?: true

Size: 525 Bytes

Versions: 1

Compression:

Stored size: 525 Bytes

Contents

# frozen_string_literal: true

require 'active_support/concern'

module PlainModel
  module Querying
    module Except
      extend ActiveSupport::Concern

      # Chain method
      # @param keys [Array<Symbol>] values keys that you want to exclude from query
      # @return new instance with applied changes
      def except(*keys)
        _within_new_instance do
          self.values = values.except(*keys)
        end
      end

      included do
        self.chainable_methods += [:except]
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
plain_model-0.1.0 lib/plain_model/querying/except.rb