22 Jan, 2016

1 commit


20 Jan, 2016

1 commit

  • Move as much code as possible to BaseMetricConfigurationsController
    instead of repeating it ad-hoc in the concrete classes. Most of the
    concrete code has gone away except for some small overrides:
    
    - Hotspot's does not have a 'new' action, and therefore can't redirect
    to it. It also does not accept any MetricConfiguration parameters.
    - Metric's only accepts 'weight' and 'aggregation_form'
    MetricConfiguration parameters. It also needs to fetch ReadingGroups to
    display in the 'choose_metric' action.
    - Compound's needs to force the Metric type when creating the metric,
    and must accept parameters for Metric ('name', 'description', 'script',
    'scope', 'code') in addition to MetricConfiguration's 'weight'.
    
    Additionally:
    - Update cache clearing to clear caches for Hotspot and Tree
    configurations
    - Verify the existence of the KalibroConfiguration and use the object
    that was fetched whenever necessary, instead of only using the id.
    - Ensure the KalibroConfiguration and ReadingGroup ids match between the
    values inside and outside the 'metric_configuration' parameter.
    Previously it was possible to send one in the URL and update another,
    which might even have been a security issue.
    - Allow sending either 'metric_code' or 'metric_name' as a parameter.
    Both are used in different places in the code, but making them uniform
    is a job for a later time.
    
    Signed off by: Daniel Miranda <danielkza2@gmail.com>
    Heitor
     

28 Oct, 2015

1 commit


26 Oct, 2015

2 commits


21 May, 2015

1 commit


27 Apr, 2015

1 commit

  • Error handling for finding resources in controllers used a find_resource
    method. It was broken and was letting code pass-through after errors. In
    addition, cases for find methods for things other than simple IDs
    weren't handled.
    
    Replace it with an error handler in ApplicationController capturing
    RecordNotFound exceptions and returning the appropriate error pages (or
    JSON).
    
    Also, fix usages of find that should throw errors (using ActiveRecord
    methods ending with !) but didn't.
    
    Correspondly, fix all the tests that mocked the find_resource method,
    and correct expectations where needed.
    
    Signed-off-by: Daniel Miranda <danielkza2@gmail.com>
    Diego Camarinha
     

17 Apr, 2015

1 commit


12 Feb, 2015

9 commits


28 Oct, 2014

1 commit


27 Oct, 2014

1 commit


21 Oct, 2014

1 commit


12 Sep, 2014

2 commits


22 Aug, 2014

1 commit


13 Apr, 2014

2 commits


05 Apr, 2014

1 commit


29 Mar, 2014

1 commit


27 Feb, 2014

1 commit


26 Feb, 2014

12 commits