Table name: transactions
id :integer not null, primary key from_user_id :integer to_user_id :integer created_at :datetime updated_at :datetime company_id :integer description :string(255) payable_amount :integer charged :boolean default(FALSE) paid :boolean default(FALSE)
Returns chargeable amount.
# File app/models/transaction.rb, line 33 def chargeable_amount amount + Money.new(100) end
Method to pay the fixxpert
# File app/models/transaction.rb, line 38 def pay_fixxpert if AccountBalance.credit(self.to_user, self, true, self.payable_amount) self.paid = true self.save(validate: false) self.create_activity key: 'transaction.payfixxpert', owner: user, recipient: fixxpert, type: 'Notification' return true end end