Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-11-03 15:04:22 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2015-11-03 15:04:22 +0300
commit819cfcef59f127a9ad92dc969570b479088a6974 (patch)
treed9e01cf24d602261d661e214b3a33ff7f349d423
parentfb2f8be4d7cddc01471b58334c33ecdee4d0b887 (diff)
parentd23ffc832c465c873ad5a70117a57bf32f0b4735 (diff)
Merge branch 'fix-inflector' into 'master'
Remove inflector rule that makes commits uncountable Signed-off-by: Dmitriy 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
-rw-r--r--app/views/search/results/_commit.html.haml (renamed from app/views/search/results/_commits.html.haml)2
-rw-r--r--config/initializers/inflections.rb21
-rw-r--r--spec/mailers/notify_spec.rb2
3 files changed, 2 insertions, 23 deletions
diff --git a/app/views/search/results/_commits.html.haml b/app/views/search/results/_commit.html.haml
index 7cff694350f..4e6c3965dc6 100644
--- a/app/views/search/results/_commits.html.haml
+++ b/app/views/search/results/_commit.html.haml
@@ -1,2 +1,2 @@
.search-result-row
- = render 'projects/commits/commit', project: @project, commit: commits
+ = render 'projects/commits/commit', project: @project, commit: commit
diff --git a/config/initializers/inflections.rb b/config/initializers/inflections.rb
index 5d46ece1e1b..9e8b0131f8f 100644
--- a/config/initializers/inflections.rb
+++ b/config/initializers/inflections.rb
@@ -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
diff --git a/spec/mailers/notify_spec.rb b/spec/mailers/notify_spec.rb
index cb67ec95d57..47863d54579 100644
--- a/spec/mailers/notify_spec.rb
+++ b/spec/mailers/notify_spec.rb
@@ -468,7 +468,7 @@ describe Notify do
subject { Notify.note_commit_email(recipient.id, note.id) }
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
is_expected.to have_subject /#{commit.title} \(#{commit.short_id}\)/