Class: Ransack::Adapters::Mongoid::Table
- Inherits:
-
Object
- Object
- Ransack::Adapters::Mongoid::Table
- Defined in:
- lib/ransack/adapters/mongoid/table.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
(also: #table_name)
Returns the value of attribute name.
Instance Method Summary collapse
- #[](name) ⇒ Object
-
#initialize(object, engine = nil) ⇒ Table
constructor
A new instance of Table.
Constructor Details
#initialize(object, engine = nil) ⇒ Table
Returns a new instance of Table.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# 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 |
Instance Attribute Details
#name ⇒ Object Also known as: table_name
Returns the value of attribute name.
5 6 7 |
# File 'lib/ransack/adapters/mongoid/table.rb', line 5 def name @name end |