Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
heptapod
heptapod
Commits
f04c1aa0b22e
Commit
f04c1aa0
authored
Nov 02, 2015
by
Dmitriy Zaporozhets
Browse files
Remove inflector rule that makes commits uncountable
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
04b01aaeba44
Changes
1
Hide whitespace changes
Inline
Side-by-side
config/initializers/inflections.rb
View file @
f04c1aa0
...
...
@@ -8,24 +8,3 @@
# inflect.irregular 'person', 'people'
# inflect.uncountable %w( fish sheep )
# end
# Mark "commits" as uncountable.
#
# Without this change, the routes
#
# resources :commit, only: [:show], constraints: {id: /[[:alnum:]]{6,40}/}
# resources :commits, only: [:show], constraints: {id: /.+/}
#
# would generate identical route helper methods (`project_commit_path`), resulting
# in one of them not getting a helper method at all.
#
# After this change, the helper methods are:
#
# project_commit_path(@project, @project.commit)
# # => "/gitlabhq/commit/bcf03b5de6c33f3869ef70d68cf06e679d1d7f9a
#
# project_commits_path(@project, 'stable/README.md')
# # => "/gitlabhq/commits/stable/README.md"
ActiveSupport
::
Inflector
.
inflections
do
|
inflect
|
inflect
.
uncountable
%w(commits)
end
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment