class Ransack::Adapters::Mongoid::Table
Attributes
name[RW]
table_name[RW]
Public Class Methods
new(object, engine = nil)
click to toggle source
# File lib/ransack/adapters/mongoid/table.rb, line 9 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
Public Instance Methods
[](name)
click to toggle source
# File lib/ransack/adapters/mongoid/table.rb, line 28 def [](name) Ransack::Adapters::Mongoid::Attribute.new self, name end