lib/story.rb in rallytastic-1.2.5 vs lib/story.rb in rallytastic-1.2.6
- old
+ new
@@ -35,10 +35,19 @@
embeds_many :revisions, :inverse_of => :story
referenced_in :iteration
referenced_in :project
referenced_in :parent, :class_name => "Story", :inverse_of => :children
references_many :children, :class_name => "Story", :inverse_of => :parent
+
+ def epic
+ if self.parent
+ return parent.epic
+ else
+ return self
+ end
+ end
+
def revision_fields
[:sized_on, :prioritized_on, :started_on, :completed_on]
end
@@ -80,11 +89,11 @@
def refresh hash_values=nil
@rally_hash = hash_values
from_rally :rally_uri, :_ref
from_rally :name
from_rally :notes
- from_rally :created_on, :_CreatedAt
+ from_rally :created_on, :CreationDate
from_rally :description
from_rally :formatted_id, :FormattedID
from_rally :updated_on, :LastUpdateDate
from_rally :accepted_on, :AcceptedDate
from_rally :blocked
@@ -97,9 +106,10 @@
parse_ref :revision_history_uri, @rally_hash["RevisionHistory"]
self.save
rescue ArgumentError #getting some bad created_on dates
puts "Errored on #{self.name}"
+ p self
self.save # save what you can
end
def associate hash_values=nil
@rally_hash = hash_values || RallyAPI.get(self)