Sha256: c04d35667326fa7cfc7c1a76c0d2603d25c6bb064b5696b5a5aaba3c81ce0308
Contents?: true
Size: 672 Bytes
Versions: 24
Compression:
Stored size: 672 Bytes
Contents
module CurationConcerns # A model name that provides routes that are namespaced to CurationConcerns, # without changing the param key. # # Example: # name = CurationConcerns::Name.new(GenericWork) # name.param_key # # => 'generic_work' # name.route_key # # => 'curation_concerns_generic_works' # class Name < ActiveModel::Name def initialize(klass, namespace = nil, name = nil) super @route_key = "curation_concerns_#{ActiveSupport::Inflector.pluralize(@param_key)}" @singular_route_key = ActiveSupport::Inflector.singularize(@route_key) @route_key << "_index" if @plural == @singular end end end
Version data entries
24 entries across 24 versions & 2 rubygems