Sha256: eaa456bed9ef526256b4d0b994b6c5c06e4cdac651762d9f0ad7b084e6fc6c17

Contents?: true

Size: 888 Bytes

Versions: 22

Compression:

Stored size: 888 Bytes

Contents

module Ransack
  module Adapters
    module Mongoid
      class Table
        attr_accessor :name

        alias :table_name :name

        def initialize(object, engine = nil)
          @object  = object
          @name    = object.collection.name
          @engine  = engine
          @columns = nil
          @aliases = []
          @table_alias = nil
          @primary_key = nil

          if Hash === engine
            # @engine  = engine[:engine] || Table.engine

            # Sometime AR sends an :as parameter to table, to let the table know
            # that it is an Alias.  We may want to override new, and return a
            # TableAlias node?
            # @table_alias = engine[:as] unless engine[:as].to_s == @name
          end
        end

        def [](name)
          Ransack::Adapters::Mongoid::Attribute.new self, name
        end

      end
    end
  end
end

Version data entries

22 entries across 22 versions & 3 rubygems

Version Path
ransack-1.8.10 lib/ransack/adapters/mongoid/table.rb
ransack-1.8.9 lib/ransack/adapters/mongoid/table.rb
ransack-1.8.8 lib/ransack/adapters/mongoid/table.rb
ransack-1.8.7 lib/ransack/adapters/mongoid/table.rb
ransack-1.8.6 lib/ransack/adapters/mongoid/table.rb
ransack-1.8.4 lib/ransack/adapters/mongoid/table.rb
ransack-1.8.3 lib/ransack/adapters/mongoid/table.rb
ransack-1.8.2 lib/ransack/adapters/mongoid/table.rb
ransack-1.8.1 lib/ransack/adapters/mongoid/table.rb
ransack-1.8.0 lib/ransack/adapters/mongoid/table.rb
ransack-1.7.0 lib/ransack/adapters/mongoid/table.rb
solidus_backend-1.0.0.pre3 vendor/bundle/gems/ransack-1.6.6/lib/ransack/adapters/mongoid/table.rb
solidus_backend-1.0.0.pre2 vendor/bundle/gems/ransack-1.6.6/lib/ransack/adapters/mongoid/table.rb
solidus_backend-1.0.0.pre vendor/bundle/gems/ransack-1.6.6/lib/ransack/adapters/mongoid/table.rb
shoppe-paypal-1.1.0 vendor/bundle/ruby/2.1.0/gems/ransack-1.6.2/lib/ransack/adapters/mongoid/table.rb
ransack-1.6.6 lib/ransack/adapters/mongoid/table.rb
ransack-1.6.5 lib/ransack/adapters/mongoid/table.rb
ransack-1.6.4 lib/ransack/adapters/mongoid/table.rb
ransack-1.6.3 lib/ransack/adapters/mongoid/table.rb
ransack-1.6.2 lib/ransack/adapters/mongoid/table.rb