30 Mar, 2016

1 commit


22 Jan, 2016

3 commits


20 Jan, 2016

4 commits

  • Signed-off-by: Rafael Reggiani Manzo <rr.manzo@gmail.com>
    Heitor
     
  • The code is pretty straightforward, just raising an Error in order to
    force subclasses to implement this.
    
    Signed-off-by: Rafael Reggiani Manzo <rr.manzo@gmail.com>
    Heitor
     
  • Also improve error reporting functions
    Daniel
     
  • 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
     

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
     

12 Feb, 2015

4 commits


10 Dec, 2014

1 commit


13 Apr, 2014

1 commit