Sha256: 82de352079ecc4200bea1460dae6f20b500ad135ccfb339e65caa74e9b98586e
Contents?: true
Size: 614 Bytes
Versions: 20
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
20 entries across 20 versions & 1 rubygems