Giter Site home page Giter Site logo

accessd / models_stats Goto Github PK

View Code? Open in Web Editor NEW
42.0 7.0 2.0 778 KB

Charts for your rails models with MetricsGraphics.js and NVD3

License: MIT License

Ruby 81.43% CoffeeScript 12.12% JavaScript 2.53% CSS 3.92%
rails activerecord statistics collect-statistics metricsgraphics graphics nvd3 ruby

models_stats's Issues

statistics_collector.rb:15 — NoMethodError: undefined method `[]' for nil:NilClass

When using a very basic .yml file, the rake task for statistics collection fails with NoMethodError: undefined method []' for nil:NilClass in statistics_collector.rb:15:

config/models_stats.yml:

total_players:
  description: "Total players"
  model: Player
  datetime_attr: :created_at

rake task execution:

$ rake models_stats:collect_stat_for_yesterday
NoMethodError: undefined method `[]' for nil:NilClass
/Users/lukas/workspaces/models_stats/lib/models_stats/statistics_collector.rb:15:in `block in collect'
/Users/lukas/workspaces/models_stats/lib/models_stats/statistics_collector.rb:13:in `each'
/Users/lukas/workspaces/models_stats/lib/models_stats/statistics_collector.rb:13:in `collect'
/Users/lukas/workspaces/models_stats/lib/tasks/models_stats.rake:5:in `block (2 levels) in <top (required)>'
/Users/lukas/.rvm/gems/ruby-2.1.5/bin/ruby_executable_hooks:15:in `eval'
/Users/lukas/.rvm/gems/ruby-2.1.5/bin/ruby_executable_hooks:15:in `<main>'
Tasks: TOP => models_stats:collect_stat_for_yesterday
(See full trace by running task with --trace)

I’m not sure why this occurs, and tried messing around with the code a bit. It seems that the code assumes a Hash on multiple occurrences while I seem to be getting an Array with my config/models_stats.yml.

If this is indeed an error in the codebase, instead of an error on my side, I’d be willing to submit an according pull request.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.