Skip to content

Commit

Permalink
Fixes a bug where #keys is tried on an Array since the earlier #sort …
Browse files Browse the repository at this point in the history
…coerces

the OrderedHash from group_by into an Array.

(Might only work on Rails >= 2.3.4.)

http://www.caboo.se/articles/2009/5/9/rails-2-3-upgrade-gotcha-aggregate-methods-are-now-orderedhash
  • Loading branch information
edavis10 committed Sep 9, 2009
1 parent 8a6e5f4 commit 3bf4cea
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/graphs_controller.rb
Expand Up @@ -221,7 +221,7 @@ def target_version_graph
end

# Set the scope of the graph
scope_end_date = issues_by_updated_on.keys.last
scope_end_date = issues_by_updated_on.to_a[-1][0] if issues_by_updated_on.size > 0 # Get the last "key". Rails 2.3 change
scope_end_date = @version.effective_date if !@version.effective_date.nil? && @version.effective_date > scope_end_date
scope_end_date = Date.today if !@version.completed?
line_end_date = Date.today
Expand Down

0 comments on commit 3bf4cea

Please sign in to comment.