Feature #32938 » 0006-Change-camelcase-rules-to-keep-special-module-or-cla.patch
config/initializers/inflections.rb | ||
---|---|---|
10 | 10 |
# inflect.irregular 'person', 'people' |
11 | 11 |
# inflect.uncountable %w( fish sheep ) |
12 | 12 |
# end |
13 | ||
14 |
class RedmineInflector < Zeitwerk::Inflector |
|
15 |
def camelize(basename, abspath) |
|
16 |
if abspath.match? /\/lib\/redmine\/version.rb/ |
|
17 |
basename.gsub!('version', 'VERSION') |
|
18 |
return basename |
|
19 |
end |
|
20 |
super |
|
21 |
end |
|
22 |
end |
|
23 | ||
24 |
Rails.autoloaders.each do |autoloader| |
|
25 |
autoloader.inflector = RedmineInflector.new |
|
26 |
autoloader.inflector.inflect( |
|
27 |
"url" => "URL", |
|
28 |
"pdf" => "PDF", |
|
29 |
"csv" => "CSV", |
|
30 |
"imap" => "IMAP", |
|
31 |
"pop3" => "POP3", |
|
32 |
"redcloth3" => "RedCloth3" |
|
33 |
) |
|
34 |
end |