diff --git a/app/controllers/people_controller.rb b/app/controllers/people_controller.rb index 08cb35e..c5daa34 100644 --- a/app/controllers/people_controller.rb +++ b/app/controllers/people_controller.rb @@ -11,11 +11,11 @@ def show def json_attributes { - only: [:doc_number, :doc_type], + only: [:doc_number, :doc_type, :email], methods: [:full_name], include: { tasks: { - only: [:name, :priority], + only: [:name, :priority, :duration], } }, } diff --git a/app/models/person.rb b/app/models/person.rb index fb684ea..211e91f 100644 --- a/app/models/person.rb +++ b/app/models/person.rb @@ -1,6 +1,8 @@ class Person < ApplicationRecord has_many :tasks + self.ignored_columns = [:email] + def full_name "#{last_name}, #{first_name}" end