lib/reviewed/base.rb in reviewed-0.1.28 vs lib/reviewed/base.rb in reviewed-0.1.29
- old
+ new
@@ -10,9 +10,25 @@
def initialize(data)
self.attributes = objectify(data)
end
+ def created_at
+ if @attributes.has_key?(:created_at)
+ Time.parse(@attributes[:created_at])
+ else
+ nil
+ end
+ end
+
+ def updated_at
+ if @attributes.has_key?(:updated_at)
+ Time.parse(@attributes[:updated_at])
+ else
+ nil
+ end
+ end
+
class << self
def path
@resource_name ||= association_name
end