This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def merge(people) | |
people.each do |id| | |
person = Person.find(id) | |
return false unless person.account.id == self.account.id | |
self.transaction do | |
person.financial_transactions.each do |ft| | |
ft.person = self | |
errors[:base] << "Erro ao salvar financial transaction" unless ft.save! | |
end |