lib/integrity/helpers/resources.rb in integrity-0.1.8 vs lib/integrity/helpers/resources.rb in integrity-0.1.9
- old
+ new
@@ -3,11 +3,17 @@
module Resources
def current_project
@project ||= Project.first(:permalink => params[:project]) or raise Sinatra::NotFound
end
- def current_build
- @build ||= current_project.builds.first(:commit_identifier => params[:build]) or raise Sinatra::NotFound
+ def current_commit
+ @commit ||= current_project.commits.first(:identifier => params[:commit]) or raise Sinatra::NotFound
end
+
+ def update_notifiers_of(project)
+ if params["notifiers"]
+ project.enable_notifiers(params["notifiers"].keys, params["notifiers"])
+ end
+ end
end
end
-end
\ No newline at end of file
+end