Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 566d717d78
Fetching contributors…

Cannot retrieve contributors at this time

23 lines (20 sloc) 0.48 kb
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
Jump to Line
Something went wrong with that request. Please try again.