mirror of
https://github.com/rickbarrette/redmine_qbo.git
synced 2025-11-09 01:14:23 -05:00
Update vehicle.rb
This commit is contained in:
@@ -71,8 +71,11 @@ class Vehicle < ActiveRecord::Base
|
|||||||
|
|
||||||
# Force Upper Case for VIN numbers
|
# Force Upper Case for VIN numbers
|
||||||
def vin=(val)
|
def vin=(val)
|
||||||
|
|
||||||
|
val = val.to_s.gsub!(/[^ABCDEFGHJKLMNPRSTUVWXYZabcdefghjklmnprstuvwxyz0123456789]/,'')
|
||||||
|
|
||||||
# The to_s is in case you get nil/non-string
|
# The to_s is in case you get nil/non-string
|
||||||
write_attribute(:vin, val.to_s.gsub!(/[^ABCDEFGHJKLMNPRSTUVWXYZabcdefghjklmnprstuvwxyz0123456789]/, '').join.upcase)
|
write_attribute(:vin, val.join.upcase)
|
||||||
end
|
end
|
||||||
|
|
||||||
# search for a vin
|
# search for a vin
|
||||||
|
|||||||
Reference in New Issue
Block a user