Sha256: 0d5e192235f8834dab21d815aa73d96a8e5a77919f6ab695ac3831668da67e8d

Contents?: true

Size: 452 Bytes

Versions: 1

Compression:

Stored size: 452 Bytes

Contents

require 'active_support/concern'
require 'active_support/core_ext/module/delegation'

module ActiveHouse
  module Querying
    extend ActiveSupport::Concern

    included do
      class_attribute :_query_class, instance_accessor: false
      self._query_class = ActiveHouse::Query
    end

    class_methods do
      delegate :to_a, :select, :where, :group_by, :limit, to: :all

      def all
        _query_class.new(self)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
active_house-0.1.5 lib/active_house/querying.rb