-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/612 join zusatzsektion model #651
Conversation
fd9c497
to
e419216
Compare
e419216
to
fd8666f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice, das sieht doch schon sehr gut aus 🥳
ich würde hier beim Naming noch etwas mehr darauf achten das der Code verständlicher wird. Ich verwende auch gerne den sac prefix für gewisse terms.
siehe Kommentare
def initialize(person, reference_date: Time.zone.today) | ||
@person = person | ||
@reference_date = reference_date | ||
end | ||
|
||
def calculate | ||
return CATEGORY_FAMILY if family_member? | ||
def calculate(consider_family: true) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def calculate(consider_family: true) | |
def calculate(concern_sac_family: true) |
consider ist für mich jetzt eher überlegen ob ich was machen soll oder nicht.
concerning ist berücksichtigen auf deutsch, oder?!
ich weiss, das war so spezifiziert 😉
ggf. einfach auch for_sac_family
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
habs auf for_sac_family
@group = join_section.group_for_neuanmeldung | ||
@created_at = Time.zone.now | ||
|
||
raise 'missing subgroup' unless group |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
raise 'missing subgroup' unless group | |
raise 'missing neuanmeldungen subgroup' unless group |
def initialize(join_section, person, join_date, family_membership: false, **params) | ||
super(join_section, person, join_date, **params) | ||
@family_membership = family_membership | ||
@group = join_section.group_for_neuanmeldung |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@group = join_section.group_for_neuanmeldung | |
@neuanmeldungen_group = join_section.group_for_neuanmeldung |
etwas längerer name, dafür aber gleich klar um was es sich handelt ?!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
via delegation gelöst
def prepare_roles(person) | ||
group.roles.build( | ||
person: person, | ||
type: group.class.const_get('NeuanmeldungZusatzsektion'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
] | ||
end | ||
|
||
it 'is invalid if person has requested membership via section' do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it 'is invalid if person has requested membership via section' do | |
it 'is invalid if person has requested membership in join section with approval' do |
] | ||
end | ||
|
||
it 'is invalid if person has requested membership via nv' do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it 'is invalid if person has requested membership via nv' do | |
it 'is invalid if person has requested membership in join section' do |
|
||
describe 'saving' do | ||
let(:person) { Fabricate(:person) } | ||
let(:group) { groups(:matterhorn) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let(:group) { groups(:matterhorn) } | |
let(:sac_section) { groups(:matterhorn) } |
end | ||
|
||
context 'single person' do | ||
describe 'group priority in sektion' do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
describe 'group priority in sektion' do | |
describe 'neuanmeldungen priority in sac section' do |
expect(role.group).to eq groups(:matterhorn_neuanmeldungen_sektion) | ||
expect(role.type).to eq 'Group::SektionsNeuanmeldungenSektion::NeuanmeldungZusatzsektion' | ||
end | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hier auch das Naming ... Grundsätzlich gibt es zwei Arten von Neuanmeldunge. ...
- mit Freigabe durch Sektion
- ohne Freigabe durch Sektion
die Begriffe hier sind sehr technisch und man muss genau wissen warum diese unterschiedlichen Gruppen vorhanden sind.
fd8666f
to
d0d1680
Compare
d0d1680
to
4f0326b
Compare
4f0326b
to
e8b836a
Compare
fixes #612