lib/kriterion/item.rb in kriterion-0.0.1 vs lib/kriterion/item.rb in kriterion-0.1.0
- old
+ new
@@ -11,10 +11,12 @@
attr_reader :section_path
attr_accessor :resources
def initialize(data)
+ super(data)
+
@uuid = data['uuid'] || SecureRandom.uuid
@id = data['id']
@title = data['title']
@description = data['description']
@severity = data['severity']
@@ -35,8 +37,20 @@
parents << section_path[0..index].join(separator)
end
parents.delete(id)
parents.reverse
+ end
+
+ def expandable?
+ true
+ end
+
+ def expandable_keys
+ [:resources]
+ end
+
+ def self.primary_key
+ :id
end
end
end