Module: Filterable::AttributeNormalization
- Defined in:
- lib/filterable/attribute_normalization.rb
Overview
Shared by the datable/sortable declaration DSLs: a bare attribute maps onto its own column, a hash aliases public names to DB columns, anything else is ignored.
Class Method Summary collapse
-
.normalize(attribute_name) ⇒ Hash
private
Normalizes a single attribute declaration into a public-name => column hash.
Class Method Details
.normalize(attribute_name) ⇒ Hash
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Normalizes a single attribute declaration into a public-name => column hash.
15 16 17 18 19 20 21 |
# File 'lib/filterable/attribute_normalization.rb', line 15 def normalize(attribute_name) case attribute_name when Hash then attribute_name when String, Symbol then { attribute_name => attribute_name } else {} end end |