mirror of
https://github.com/rickbarrette/redmine_qbo.git
synced 2026-10-04 01:00:44 -04:00
Update vehicle.rb
This commit is contained in:
1 parent
56793cee7c
commit
625e400c48
1 file changed
+4
-1
@@ -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