# load data
@drilldown = Drilldown.new(@project, @metric, selected_rids, options)
- @snapshot = @drilldown.snapshot
access_denied unless has_role?(:user, @snapshot)
@highlighted_resource=@drilldown.highlighted_resource
# load data
@drilldown = Drilldown.new(@project, @metric, @selected_rids, options)
- @snapshot=@drilldown.snapshot
access_denied unless has_role?(:user, @snapshot)
@highlighted_resource=@drilldown.highlighted_resource
@project = project_key ? Project.by_key(project_key) : nil
# For security reasons, we must not return 404 not found. It would be an information that the resource exists.
not_found("Resource not found") unless @project
+ @snapshot = @project.last_snapshot
end
def select_metric(metric_key, default_key)
def initialize(resource, metric, selected_resource_ids, options={})
@resource=resource
- @snapshot=Snapshot.find(:first, :conditions => {:islast => true, :project_id => resource.id}, :include => [:project])
+ @snapshot=resource.last_snapshot
@metric=metric
@columns=[]