Create invalid_char validators and apply to models
This commit is contained in:
parent
64816e50b5
commit
c2f23fea6a
25 changed files with 91 additions and 60 deletions
|
@ -2,7 +2,7 @@
|
|||
#
|
||||
# Table name: user_preferences
|
||||
#
|
||||
# user_id :integer not null, primary key
|
||||
# user_id :bigint(8) not null, primary key
|
||||
# k :string not null, primary key
|
||||
# v :string not null
|
||||
#
|
||||
|
@ -17,7 +17,7 @@ class UserPreference < ActiveRecord::Base
|
|||
belongs_to :user
|
||||
|
||||
validates :user, :presence => true, :associated => true
|
||||
validates :k, :v, :length => 1..255
|
||||
validates :k, :v, :length => 1..255, :invalid_chars => true
|
||||
|
||||
# Turn this Node in to an XML Node without the <osm> wrapper.
|
||||
def to_xml_node
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue