Class: Payment

Inherits:
ApplicationRecord show all
Defined in:
app/models/payment.rb

Overview

Effective payment of a reimbursement

Instance Attribute Summary collapse

Belongs to collapse

Methods inherited from ApplicationRecord

ransackable_associations, ransackable_attributes

Instance Attribute Details

#amount ⇒ Decimal

Returns:

  • (Decimal)

Validations:



10
# File 'app/models/payment.rb', line 10

validates :amount, :reimbursement, :currency, :date, :method, presence: true

#code ⇒ String

Returns:

  • (String)


129
# File 'db/schema.rb', line 129

t.string "code"

#cost_amount ⇒ Decimal

Returns:

  • (Decimal)


126
# File 'db/schema.rb', line 126

t.decimal "cost_amount", precision: 10, scale: 2

#cost_currency ⇒ String

Returns:

  • (String)


127
# File 'db/schema.rb', line 127

t.string "cost_currency"

#created_at ⇒ DateTime

Returns:

  • (DateTime)


133
# File 'db/schema.rb', line 133

t.datetime "created_at"

#currency ⇒ String

Returns:

  • (String)

Validations:



10
# File 'app/models/payment.rb', line 10

validates :amount, :reimbursement, :currency, :date, :method, presence: true

#date ⇒ Date

Returns:

  • (Date)

Validations:



10
# File 'app/models/payment.rb', line 10

validates :amount, :reimbursement, :currency, :date, :method, presence: true

#file ⇒ String

Returns:

  • (String)


132
# File 'db/schema.rb', line 132

t.string "file"

#method ⇒ String

Returns:

  • (String)

Validations:



10
# File 'app/models/payment.rb', line 10

validates :amount, :reimbursement, :currency, :date, :method, presence: true

#notes ⇒ Text

Returns:

  • (Text)


131
# File 'db/schema.rb', line 131

t.text "notes"

#subject ⇒ String

Returns:

  • (String)


130
# File 'db/schema.rb', line 130

t.string "subject"

#updated_at ⇒ DateTime

Returns:

  • (DateTime)


134
# File 'db/schema.rb', line 134

t.datetime "updated_at"

Instance Method Details

#reimbursement ⇒ Reimbursement

The associated reimbursement

Validations:



8
# File 'app/models/payment.rb', line 8

belongs_to :reimbursement, inverse_of: :payments