projecttacoma/bonnie — pull request #46 by jtferns (2014-01-03 21:16:24+00:00)
Title: Fixed issue with showing upload dialog when user has no measures

- Since the measure_controller has been updated to no longer support an index method, a user with no measures doesn't load any measures after hitting the root_path and subsequently tries to load measures via the measure_controller's index path.
- This still is an **issue** and causes the server to return a 500 error. Adding an empty index.json.erb file in the measures directory resolves this error, but I'm not sure if there's an underlying issue with application.html.erb when attempting to load non-existing measures, so I left the file out for this pull request.
- The reason why the dialog won't show is because the @collection.isEmpty() method returns false because it's internal isPopulated() method returns false since there are no measures being loaded. Checking the length instead of calling isEmpty() resolves this, but it may be sidestepping a model-loading issue...