From 3e285cdf01592edf46b73b069099e355ee4accc4 Mon Sep 17 00:00:00 2001 From: yasushiito Date: Sun, 20 Jan 2013 18:44:54 +0900 Subject: [PATCH] t#30505:fix token broken problem --- app/models/provider_status.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/models/provider_status.rb b/app/models/provider_status.rb index 3902804f..2ef6510d 100644 --- a/app/models/provider_status.rb +++ b/app/models/provider_status.rb @@ -1,12 +1,16 @@ class ProviderStatus < ActiveRecord::Base has_one :provider -# validates :token + validates :token, :format => {:with => /^[a-zA-Z0-9]+$/, :allow_blank => true} validates :receive_hour1, :numericality => {:allow_blank => true} validates :receive_hour2, :numericality => {:allow_blank => true} # validates :received_at # validates :stopped_at + before_save do |r| + r.token = r.token.gsub(/\s/, '') if r.token + end + def supply_default end -- 2.11.0