lib/siteleaf/entity.rb in siteleaf-2.0.0.pre.beta5 vs lib/siteleaf/entity.rb in siteleaf-2.0.0.pre.beta7
- old
+ new
@@ -7,10 +7,10 @@
self.attributes = attributes
end
def self.all
result = Client.get "#{self.endpoint}"
- result.map { |r| self.new(r) } if result
+ result.map { |r| self.new(r) } if result.is_a? Array
end
def self.find(id)
result = Client.get "#{self.endpoint}/#{id}"
self.new(result) if result