Module: Integrity::Helpers::Resources

Included in:
Integrity::Helpers
Defined in:
lib/integrity/helpers/resources.rb

Instance Method Summary collapse

Instance Method Details

#current_commitObject



8
9
10
# File 'lib/integrity/helpers/resources.rb', line 8

def current_commit
  @commit ||= current_project.commits.first(:identifier => params[:commit]) or raise Sinatra::NotFound
end

#current_projectObject



4
5
6
# File 'lib/integrity/helpers/resources.rb', line 4

def current_project
  @project ||= Project.first(:permalink => params[:project]) or raise Sinatra::NotFound
end

#update_notifiers_of(project) ⇒ Object



12
13
14
15
16
# File 'lib/integrity/helpers/resources.rb', line 12

def update_notifiers_of(project)
  if params["notifiers"]
    project.update_notifiers(params["enabled_notifiers"] || [], params["notifiers"])
  end
end