OSDN Git Service
(root)
/
pettanr
/
pettanr.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
81bc2c1
)
t#30505:fix token broken problem
author
yasushiito
<yas@pen-chan.jp>
Sun, 20 Jan 2013 09:44:54 +0000
(18:44 +0900)
committer
yasushiito
<yas@pen-chan.jp>
Sun, 20 Jan 2013 09:44:54 +0000
(18:44 +0900)
app/models/provider_status.rb
patch
|
blob
|
history
diff --git
a/app/models/provider_status.rb
b/app/models/provider_status.rb
index
3902804
..
2ef6510
100644
(file)
--- 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