diff --git a/app/models/collected_pen.rb b/app/models/collected_pen.rb index 8d57f456c..6945691b9 100644 --- a/app/models/collected_pen.rb +++ b/app/models/collected_pen.rb @@ -98,6 +98,8 @@ def name model: model, nib: nib, color: color, + material: material, + trim_color: trim_color, archived: archived? ) end diff --git a/app/models/concerns/pen_name.rb b/app/models/concerns/pen_name.rb index eca59b687..63be40ed6 100644 --- a/app/models/concerns/pen_name.rb +++ b/app/models/concerns/pen_name.rb @@ -1,9 +1,17 @@ module PenName extend ActiveSupport::Concern - def pen_name_generator(brand:, model:, nib:, color:, archived:) + def pen_name_generator( + brand:, + model:, + nib:, + color:, + material:, + trim_color:, + archived: + ) n = "#{brand} #{model}" - n = [n, color, nib].reject { |f| f.blank? }.join(", ") + n = [n, color, material, trim_color, nib].reject { |f| f.blank? }.join(", ") n = "#{n} (archived)" if archived n end diff --git a/app/models/currently_inked.rb b/app/models/currently_inked.rb index 4ac6bca91..d06957bea 100644 --- a/app/models/currently_inked.rb +++ b/app/models/currently_inked.rb @@ -91,6 +91,8 @@ def pen_name model: collected_pen.model, nib: nib, color: collected_pen.color, + material: collected_pen.material, + trim_color: collected_pen.trim_color, archived: collected_pen.archived? ) end diff --git a/spec/models/currently_inked_spec.rb b/spec/models/currently_inked_spec.rb index 96d92b165..c4ebd1bb3 100644 --- a/spec/models/currently_inked_spec.rb +++ b/spec/models/currently_inked_spec.rb @@ -237,12 +237,16 @@ end it "uses the nib from the pen" do - expect(subject.pen_name).to eq("Pilot Custom 74, orange, M") + expect(subject.pen_name).to eq( + "Pilot Custom 74, orange, plastic, gold, M" + ) end it "uses the nib from self" do subject.nib = "my nib" - expect(subject.pen_name).to eq("Pilot Custom 74, orange, my nib") + expect(subject.pen_name).to eq( + "Pilot Custom 74, orange, plastic, gold, my nib" + ) end end