Add method Person#related_to_party? and other
This commit is contained in:
parent
c073717a0d
commit
7a3856cc52
|
@ -27,6 +27,6 @@ class MembershipApp < ApplicationRecord
|
|||
end
|
||||
|
||||
def resolved?
|
||||
person.present?
|
||||
person&.related_to_party?
|
||||
end
|
||||
end
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Reference in New Issue