1
0
mirror of https://github.com/fspc/BikeShed-1.git synced 2025-02-28 08:43:23 -05:00

Merge pull request #95 from spacemunkay/denney-improve-wheel-display

Don't attempt to show a wheel size if it's blank
This commit is contained in:
Jason Denney 2013-11-04 06:39:34 -08:00
commit 5212011256

View File

@ -2,7 +2,12 @@ class BikeWheelSize < ActiveRecord::Base
belongs_to :bike belongs_to :bike
def display_string def display_string
["#{twmm}-#{rdmm}", "#{rdin}x#{twin}", "#{rdfr}x#{twfr}", description].join(" | ") result = []
result << "#{twmm}-#{rdmm}" unless twmm.blank? and rdmm.blank?
result << "#{rdin}x#{twin}" unless rdin.blank? and twin.blank?
result << "#{rdfr}x#{twfr}" unless rdfr.blank? and twfr.blank?
result << description unless description.blank?
result.join(" | ")
end end
def to_s def to_s