CRUD API ready

This commit is contained in:
Senad Uka
2019-06-21 20:01:43 +02:00
parent 877f0425d0
commit 0357df32a7
8 changed files with 36 additions and 8 deletions

View File

@@ -1,3 +1,4 @@
class ApplicationRecord < ActiveRecord::Base
self.abstract_class = true
end

View File

@@ -1,5 +0,0 @@
module Response
def json_response(object, status = :ok)
render json: object, status: status
end
end

View File

@@ -1,4 +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
has_many :money_moves_from, class_name: 'MoneyMove', foreign_key: :from_homie_id
has_many :money_moves_to, class_name: 'MoneyMove', foreign_key: :to_homie_id
end