Module: RailsAdmin::Support::CompositeKeysSerializer
- Defined in:
- lib/rails_admin/support/composite_keys_serializer.rb
Class Method Summary collapse
Class Method Details
.deserialize(string) ⇒ Object
10 11 12 |
# File 'lib/rails_admin/support/composite_keys_serializer.rb', line 10 def self.deserialize(string) string.split('_').map { |key| key&.gsub('__', '_') } end |
.serialize(keys) ⇒ Object
6 7 8 |
# File 'lib/rails_admin/support/composite_keys_serializer.rb', line 6 def self.serialize(keys) keys.map { |key| key&.to_s&.gsub('_', '__') }.join('_') end |