Class: MagicGrid::FilterOnlyColumn
- Defined in:
- lib/magic_grid/column.rb
Instance Attribute Summary collapse
-
#custom_sql ⇒ Object
readonly
Returns the value of attribute custom_sql.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name, collection = nil) ⇒ FilterOnlyColumn
constructor
A new instance of FilterOnlyColumn.
Methods inherited from Column
columns_for_collection, hash_string, #html_classes, #id, #label, #reader, searchable_column, #sortable?
Constructor Details
#initialize(name, collection = nil) ⇒ FilterOnlyColumn
Returns a new instance of FilterOnlyColumn.
88 89 90 91 92 93 94 95 |
# File 'lib/magic_grid/column.rb', line 88 def initialize(name, collection = nil) @name = name if collection @custom_sql = collection.quote_column_name(name) else @custom_sql = name end end |
Instance Attribute Details
#custom_sql ⇒ Object (readonly)
Returns the value of attribute custom_sql.
87 88 89 |
# File 'lib/magic_grid/column.rb', line 87 def custom_sql @custom_sql end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
87 88 89 |
# File 'lib/magic_grid/column.rb', line 87 def name @name end |