apps/blueprint/models/epic.rb in brief-1.17.2 vs apps/blueprint/models/epic.rb in brief-1.17.3

- old
+ new

@@ -1,7 +1,8 @@ class Brief::Apps::Blueprint::Epic include Brief::Model + include Brief::RemoteSyncing defined_in Pathname(__FILE__) meta do title @@ -59,10 +60,22 @@ helpers do def features briefcase.features(project: project, epic: title) end + def active? + status.to_s.downcase == "active" + end + + def published? + status.to_s.downcase == "published" + end + + def draft? + status.to_s.downcase == "draft" || status.to_s == "" + end + def parent_project briefcase.projects(project: project).first end def find_feature_by_title(feature_title) @@ -78,16 +91,27 @@ behavior: item.components[1]) end end + def generate_feature(feature_heading) + path = feature_file_for(feature_heading) + FileUtils.mkdir_p(path.dirname) + + c = generate_feature_content(c) + + path.open("w+") do |fh| + fh.write(c) + end + end + def generate_feature_content(feature_heading) if feature_file_for(feature_heading).exist? return feature_file_for(feature_heading).read end data = { - status: "published", + status: status, project: project, epic: title, title: feature_heading }