1
0
Fork 0

Add method Person#related_to_party? and other

This commit is contained in:
Alex Kotov 2018-12-15 10:34:46 +05:00
parent c073717a0d
commit 7a3856cc52
No known key found for this signature in database
GPG Key ID: 4E831250F47DE154
3 changed files with 22 additions and 1 deletions

View File

@ -27,6 +27,6 @@ class MembershipApp < ApplicationRecord
end
def resolved?
person.present?
person&.related_to_party?
end
end

View File

@ -10,4 +10,20 @@ class Person < ApplicationRecord
inverse_of: :person,
through: :account,
source: :own_membership_app
def related_to_party?
party_supporter? || party_member? || excluded_from_party?
end
def party_supporter?
false
end
def party_member?
true
end
def excluded_from_party?
false
end
end

View File

@ -19,4 +19,9 @@ RSpec.describe Person do
end
it { is_expected.not_to validate_presence_of :regional_office }
pending '#related_to_party?'
pending '#party_supporter?'
pending '#party_member?'
pending '#excluded_from_party?'
end