From 7ef8afb1ba39699c622894c3790cdcef524924ec Mon Sep 17 00:00:00 2001 From: Miles Gould Date: Sun, 11 Jan 2015 11:19:12 +0000 Subject: [PATCH 1/2] Tests for crop inflections --- spec/features/crops/inflections_spec.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 spec/features/crops/inflections_spec.rb diff --git a/spec/features/crops/inflections_spec.rb b/spec/features/crops/inflections_spec.rb new file mode 100644 index 000000000..93c1f0e24 --- /dev/null +++ b/spec/features/crops/inflections_spec.rb @@ -0,0 +1,13 @@ +require 'spec_helper' + +feature "irregular crop inflections" do + + # We're just testing a couple of representative crops to + # check that inflection works: you don't need to add + # every crop here. + scenario "crops which are mass nouns" do + expect("kale".pluralize).to eq "kale" + expect("broccoli".pluralize).to eq "broccoli" + end + +end From 401777cc4c2cfeb44679404d80c9f9b65101bb54 Mon Sep 17 00:00:00 2001 From: Miles Gould Date: Sun, 11 Jan 2015 10:14:36 +0000 Subject: [PATCH 2/2] Add some irregular plurals. --- config/initializers/inflections.rb | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/config/initializers/inflections.rb b/config/initializers/inflections.rb index 1d78b7ba8..caaa7c059 100644 --- a/config/initializers/inflections.rb +++ b/config/initializers/inflections.rb @@ -16,4 +16,11 @@ ActiveSupport::Inflector.inflections do |inflect| inflect.plural 'square foot', 'square feet' + inflect.plural 'broccoli', 'broccoli' + inflect.plural 'kale', 'kale' + inflect.plural 'squash', 'squash' + inflect.plural 'bok choy', 'bok choy' + inflect.plural 'achiote', 'achiote' + inflect.plural 'alfalfa', 'alfalfa' + inflect.plural 'allspice', 'allspice' end