gemhome / fnordmetric

(possible new home for) FnordMetric is a redis/ruby-based realtime Event-Tracking app
0 stars 1 forks source link

Possible method name clash with ActiveRecod? #74

Open bf4 opened 10 years ago

bf4 commented 10 years ago

Issue by Onumis Monday Nov 11, 2013 at 18:12 GMT Originally opened as https://github.com/paulasmuth/fnordmetric/issues/169


I'm having a new error showing up after I updated FnordMetric from v0.7.5 to v1.2.9:

@reviews.average(:accuracy)
ArgumentError: wrong number of arguments (1 for 0)
  from /home/.../shared/bundle/ruby/1.9.1/gems/fnordmetric-1.2.9/lib/fnordmetric/ext.rb:37:in `mean'
  from /home/.../shared/bundle/ruby/1.9.1/gems/activerecord-.2.13/lib/active_record/associations/collection_proxy.rb:89:in `method_missing'
  ...

I can work around it by doing @reviews.sum(:accuracy) / @reviews.count, but this is a strange issue, and I wonder if you can help me on figuring out why this happens.

(Using Rails 3.2.13)

bf4 commented 10 years ago

Comment by Onumis Monday Nov 11, 2013 at 18:26 GMT


Possible guilty: https://github.com/paulasmuth/fnordmetric/blob/master/fnordmetric-core/lib/fnordmetric/ext.rb#L42

bf4 commented 10 years ago

Comment by Onumis Monday Nov 11, 2013 at 18:35 GMT


Another interesting fact: Doing: