Sha256: 68b36700a1b2a2aea02718824603e4cc4b5f15bbac16dfe38b88153f609452b1

Contents?: true

Size: 646 Bytes

Versions: 4

Compression:

Stored size: 646 Bytes

Contents

# frozen_string_literal: true

require 'active_support/concern'

module ActiveHouse
  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)
        dup.except!(*keys)
      end

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

    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
active_house-0.8.0 lib/active_house/querying/except.rb
active_house-0.7.0 lib/active_house/querying/except.rb
active_house-0.6.6 lib/active_house/querying/except.rb
active_house-0.6.5 lib/active_house/querying/except.rb