Commit 819cfcef authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'fix-inflector' into 'master'

Remove inflector rule that makes commits uncountable
Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>

Before: 

```
>> "commits".singularize
=> "commits"
>> "commit".pluralize
=> “commits”
```

After: 

```
>> "commits".singularize
=> "commit"
>> "commit".pluralize
=> “commits”
```

cc @rspeicher 

See merge request !1726
parents fb2f8be4 d23ffc83
.search-result-row .search-result-row
= render 'projects/commits/commit', project: @project, commit: commits = render 'projects/commits/commit', project: @project, commit: commit
...@@ -8,24 +8,3 @@ ...@@ -8,24 +8,3 @@
# inflect.irregular 'person', 'people' # inflect.irregular 'person', 'people'
# inflect.uncountable %w( fish sheep ) # inflect.uncountable %w( fish sheep )
# end # 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
...@@ -468,7 +468,7 @@ describe Notify do ...@@ -468,7 +468,7 @@ describe Notify do
subject { Notify.note_commit_email(recipient.id, note.id) } subject { Notify.note_commit_email(recipient.id, note.id) }
it_behaves_like 'a note email' it_behaves_like 'a note email'
it_behaves_like 'an answer to an existing thread', 'commits' it_behaves_like 'an answer to an existing thread', 'commit'
it 'has the correct subject' do it 'has the correct subject' do
is_expected.to have_subject /#{commit.title} \(#{commit.short_id}\)/ is_expected.to have_subject /#{commit.title} \(#{commit.short_id}\)/
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment