Homies and money moves
This commit is contained in:
0
app/models/concerns/error_response.rb
Normal file
0
app/models/concerns/error_response.rb
Normal file
5
app/models/concerns/json_response.rb
Normal file
5
app/models/concerns/json_response.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
module Response
|
||||
def json_response(object, status = :ok)
|
||||
render json: object, status: status
|
||||
end
|
||||
end
|
||||
4
app/models/homie.rb
Normal file
4
app/models/homie.rb
Normal file
@@ -0,0 +1,4 @@
|
||||
class Homie < ApplicationRecord
|
||||
has_many :money_moves_from, class_name: 'MoneyMove', column: :from_homie_id
|
||||
has_many :money_moves_to, class_name: 'MoneyMove', column: :to_homie_id
|
||||
end
|
||||
4
app/models/money_move.rb
Normal file
4
app/models/money_move.rb
Normal file
@@ -0,0 +1,4 @@
|
||||
class MoneyMove < ApplicationRecord
|
||||
belongs_to :from_homie, class_name: 'Homie'
|
||||
belongs_to :to_homie, class_name: 'Homie'
|
||||
end
|
||||
Reference in New Issue
Block a user