Sha256: 028eec236ae4f20cab048eec7921ae5ade10057c991732ac78fbfd1c9ca0b9dd
Contents?: true
Size: 480 Bytes
Versions: 20
Compression:
Stored size: 480 Bytes
Contents
module ActiveSupport class ModelName < String attr_reader :singular, :plural, :partial_path def initialize(name) super @singular = underscore.tr('/', '_').freeze @plural = @singular.pluralize.freeze @partial_path = "#{tableize}/#{demodulize.underscore}".freeze end end module CoreExt module Module module ModelNaming def model_name @model_name ||= ModelName.new(name) end end end end end
Version data entries
20 entries across 20 versions & 5 rubygems