From a0118cb163108eb2de525561af8ffd2f54623c3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juanjo=20Baza=CC=81n?= Date: Tue, 27 Dec 2016 17:45:01 +0100 Subject: [PATCH] associates officer_assignments to officer --- app/models/poll/officer.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/models/poll/officer.rb b/app/models/poll/officer.rb index d6fe5730a..48a9e171c 100644 --- a/app/models/poll/officer.rb +++ b/app/models/poll/officer.rb @@ -1,8 +1,10 @@ class Poll class Officer < ActiveRecord::Base belongs_to :user - delegate :name, :email, to: :user + has_many :officer_assignments, class_name: "Poll::OfficerAssignment" validates :user_id, presence: true, uniqueness: true + + delegate :name, :email, to: :user end end \ No newline at end of file