summaryrefslogtreecommitdiff
path: root/model.rb
diff options
context:
space:
mode:
Diffstat (limited to 'model.rb')
-rw-r--r--model.rb12
1 files changed, 8 insertions, 4 deletions
diff --git a/model.rb b/model.rb
index 5332629..5b1f4f5 100644
--- a/model.rb
+++ b/model.rb
@@ -1,13 +1,18 @@
require 'ohm'
+require 'ohm/contrib'
class ToxCreateModel < Ohm::Model
+ include Ohm::Callbacks
+ include Ohm::Typecast
+ include Ohm::Timestamping
+
attribute :name
attribute :warnings
attribute :error_messages
attribute :type
attribute :status
- attribute :created_at
+ attribute :created_at, Date
attribute :task_uri
attribute :uri
@@ -42,7 +47,7 @@ class ToxCreateModel < Ohm::Model
attr_accessor :subjectid
@subjectid = nil
- #after :save, :check_policy
+ after :save, :check_policy
def validation_status
begin
@@ -73,5 +78,4 @@ class ToxCreateModel < Ohm::Model
OpenTox::Authorization.check_policy(web_uri, subjectid)
end
-end
-
+end \ No newline at end of file