Commit 21eb9a5b8b2ae07f0948b0872eae64bcb3c13440
Committed by
João M. M. da Silva
1 parent
527b4c86
Exists in
master
and in
29 other branches
[Mezuro] Fixed Kalibro::Project.all when it should return just 1 project
and Kalibro::Configuration.all when it should return just 1 configuration
Showing
1 changed file
with
2 additions
and
1 deletions
Show diff stats
plugins/mezuro/lib/kalibro/project.rb
@@ -3,8 +3,9 @@ class Kalibro::Project < Kalibro::Model | @@ -3,8 +3,9 @@ class Kalibro::Project < Kalibro::Model | ||
3 | attr_accessor :id, :name, :description | 3 | attr_accessor :id, :name, :description |
4 | 4 | ||
5 | def self.all | 5 | def self.all |
6 | - response = request(:all_projects)[:project].to_a | 6 | + response = request(:all_projects)[:project] |
7 | response = [] if response.nil? | 7 | response = [] if response.nil? |
8 | + response = [response] if response.is_a? (Hash) | ||
8 | response.map {|project| new project} | 9 | response.map {|project| new project} |
9 | end | 10 | end |
10 | 11 |