lib/plaid/models/user.rb in plaid-1.6.1 vs lib/plaid/models/user.rb in plaid-1.6.2
- old
+ new
@@ -157,13 +157,10 @@
self.api_res = res[:msg]
end
def populate_user!(res)
res['accounts'].each do |account|
- if self.accounts.any? { |h| h == account['_id'] }
- owned_account = self.accounts.find { |h| h == account['_id'] }
- owned_account.new(account)
- else
+ if self.accounts.none? { |h| h.id == account['_id'] }
self.accounts << Account.new(account)
end
end if res['accounts']
res['transactions'].each do |transaction|