Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timeseries Widget: convert tick Enum to Arr for .last #164

Merged
merged 1 commit into from
Jun 16, 2014

Conversation

anapsix
Copy link

@anapsix anapsix commented Aug 22, 2013

Avoid NoMethodError on tick.last by converting it to array

NoMethodError - undefined method `last' for #<Enumerator: 1377191030..1377191330:step(10)>
/var/lib/gems/1.9.1/gems/fnordmetric-1.2.9/lib/fnordmetric/widgets/timeseries_widget.rb:35:in `data'
/var/lib/gems/1.9.1/gems/fnordmetric-1.2.9/lib/fnordmetric/widget.rb:75:in `render'

@localhots
Copy link

👍

1 similar comment
@elia
Copy link

elia commented Sep 5, 2013

👍

@elia
Copy link

elia commented Sep 5, 2013

For a quick fix add the following code on the top of your file:

module Enumerable
  def last
    to_a.last
  end
end

@anapsix
Copy link
Author

anapsix commented Jun 16, 2014

woot!

@anapsix anapsix deleted the upstream-issue163 branch June 16, 2014 19:49
@elia
Copy link

elia commented Jun 17, 2014

😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants