lib/lifen/flow.rb in lifen-0.1.1 vs lib/lifen/flow.rb in lifen-0.1.2
- old
+ new
@@ -24,10 +24,10 @@
params = users.map(&:uuid).compact.uniq
json = client.post("central/api/chats/#{uuid}/attach_users?rel=activeUsers", params)
- json["activeUsers"].each do |element|
+ Array(json["activeUsers"]).each do |element|
self.active_users << Lifen::User.new(element)
end
users.each do |user|
raise Lifen::Error, "User #{user.uuid} was not attached to this flow" if !active_users.map(&:uuid).include? user.uuid
\ No newline at end of file