added uri

This commit is contained in:
Mike Slemmer 2013-07-31 19:05:38 -07:00
parent a58db24d15
commit 9d2b51c66e
1 changed files with 6 additions and 0 deletions

View File

@ -6,5 +6,11 @@ module JamRuby
self.primary_key = 'id'
validates :client_type, presence: true
before_validation(:on => :create) do
self.created_at ||= Time.now
self.id = SecureRandom.uuid
self.uri = "dump/#{self.id}-#{self.created_at.to_i}"
end
end
end