Methods
A
C
D
E
I
M
N
S
U
Instance Public methods
create()
# File app/controllers/milestones_controller.rb, line 44
def create
  @milestone = @project.milestones.new(params[:milestone])
  @milestone.author_id_of_changes = current_user.id

  if @milestone.save
    redirect_to project_milestone_path(@project, @milestone)
  else
    render "new"
  end
end
destroy()
# File app/controllers/milestones_controller.rb, line 70
def destroy
  return access_denied! unless can?(current_user, :admin_milestone, @milestone)

  @milestone.destroy

  respond_to do |format|
    format.html { redirect_to project_milestones_path }
    format.js { render nothing: true }
  end
end
edit()
# File app/controllers/milestones_controller.rb, line 29
def edit
  respond_with(@milestone)
end
index()
# File app/controllers/milestones_controller.rb, line 13
def index
  @milestones = case params[:f]
                when 'all'; @project.milestones.order("closed, due_date DESC")
                when 'closed'; @project.milestones.closed.order("due_date DESC")
                else @project.milestones.active.order("due_date ASC")
                end

  @milestones = @milestones.includes(:project)
  @milestones = @milestones.page(params[:page]).per(20)
end
new()
# File app/controllers/milestones_controller.rb, line 24
def new
  @milestone = @project.milestones.new
  respond_with(@milestone)
end
show()
# File app/controllers/milestones_controller.rb, line 33
def show
  @issues = @milestone.issues
  @users = UserDecorator.decorate(@milestone.participants)
  @merge_requests = @milestone.merge_requests

  respond_to do |format|
    format.html
    format.js
  end
end
update()
# File app/controllers/milestones_controller.rb, line 55
def update
  @milestone.update_attributes(params[:milestone].merge(author_id_of_changes: current_user.id))

  respond_to do |format|
    format.js
    format.html do
      if @milestone.valid?
        redirect_to [@project, @milestone]
      else
        render :edit
      end
    end
  end
end
Instance Protected methods
authorize_admin_milestone!()
# File app/controllers/milestones_controller.rb, line 87
def authorize_admin_milestone!
  return render_404 unless can?(current_user, :admin_milestone, @project)
end
milestone()
# File app/controllers/milestones_controller.rb, line 83
def milestone
  @milestone ||= @project.milestones.find(params[:id])
end
module_enabled()
# File app/controllers/milestones_controller.rb, line 91
def module_enabled
  return render_404 unless @project.issues_enabled
end