Class: Katalyst::Tables::Suggestions::DatabaseValue
- Defined in:
- app/models/katalyst/tables/suggestions/database_value.rb
Instance Attribute Summary collapse
-
#column ⇒ Object
readonly
Returns the value of attribute column.
-
#model ⇒ Object
readonly
Returns the value of attribute model.
Instance Method Summary collapse
-
#initialize(name:, type:, model:, column:, value:) ⇒ DatabaseValue
constructor
A new instance of DatabaseValue.
- #type ⇒ Object
- #value ⇒ Object
Methods inherited from Base
Constructor Details
#initialize(name:, type:, model:, column:, value:) ⇒ DatabaseValue
Returns a new instance of DatabaseValue.
11 12 13 14 15 16 17 18 |
# File 'app/models/katalyst/tables/suggestions/database_value.rb', line 11 def initialize(name:, type:, model:, column:, value:) super(value) @attribute_type = type @model = model @column = column @name = name end |
Instance Attribute Details
#column ⇒ Object (readonly)
Returns the value of attribute column.
7 8 9 |
# File 'app/models/katalyst/tables/suggestions/database_value.rb', line 7 def column @column end |
#model ⇒ Object (readonly)
Returns the value of attribute model.
7 8 9 |
# File 'app/models/katalyst/tables/suggestions/database_value.rb', line 7 def model @model end |
Instance Method Details
#type ⇒ Object
20 21 22 |
# File 'app/models/katalyst/tables/suggestions/database_value.rb', line 20 def type :database_value end |
#value ⇒ Object
26 27 28 29 30 31 32 |
# File 'app/models/katalyst/tables/suggestions/database_value.rb', line 26 def value if @attribute_type.multiple? && @value.is_a?(Array) && @value.length == 1 to_param(@value.first) else to_param(@value) end end |