Sha256: 9b8d57610173da19bc94f5083f43101533fa492c9215316e20704673e576f72c
Contents?: true
Size: 614 Bytes
Versions: 35
Compression:
Stored size: 614 Bytes
Contents
# frozen_string_literal: true module Motor module BuildSchema module Utils ABBREVIATIONS = { 'Id' => 'ID', 'Url' => 'URL', 'Iso' => 'ISO', 'vip' => 'VIP', 'Ip' => 'IP', 'Zip' => 'ZIP' }.freeze module_function def slugify(model) model.name.underscore.pluralize.gsub('/', '__') end def classify_slug(slug) slug.singularize.gsub('__', '/').classify.constantize end def humanize_column_name(column_name) ABBREVIATIONS.fetch(column_name, column_name.humanize) end end end end
Version data entries
35 entries across 35 versions & 1 rubygems