Skip to content

Dependent destroy #120

Merged
merged 26 commits into from Mar 29, 2012

3 participants

@anjonas
The Water Project member
anjonas commented Mar 21, 2012

Känner mig klar med dependent destroy relationerna, kolla på koden och se om jag har missat någonting.

anjonas and others added some commits Mar 15, 2012
@anjonas anjonas Implement dependent destroy between student and student_registered_fo…
…r_course with test #98
f055f3a
@anjonas anjonas Implement dependent destory between given_course and studen_registere…
…d_for_course with test
6985cc2
@anjonas anjonas Implement dependent destroy between given_course and lab_group with test c340fb0
@anjonas anjonas Implement dependent destroy between user and student, and test #98 f5109b8
@anjonas anjonas Implement dependent destroy between user and examiner, with test #98 e263e22
@anjonas anjonas Implement dependent destroy between user and assistant, with test #98 00218ab
@anjonas anjonas Implement dependent destroy between lab_group and lab_has_group, with…
… test #98
7b0607e
@anjonas anjonas Implement dependent destroy between lab and default_deadline, with test 40eebca
@anjonas anjonas Implement dependent destroy between lab and lab_has_group, with test #98
348a524
@anjonas anjonas Implement dependent destroy between assistant and assistant_registere…
…d_for_course with test #98
5b235af
@anjonas anjonas Implement dependent destroy between given_course and assistant_regist…
…erd_to_given_course, with test #98
3be9f43
@anjonas anjonas Implement dependent destroy between user and administrator with test #98
9552a4e
@oleander oleander Lab should be removed when given course is destroyed [#98] 17b8662
@oleander oleander Merge branch 'master' into dependent-destroy
Conflicts:
	app/models/student.rb
	app/models/user.rb
	spec/models/user_spec.rb
45b9938
@oleander oleander Fix migration error in user model f023c50
@oleander oleander Fix migration error in student model 02771ec
@oleander oleander Merge branch 'master' into dependent-destroy
Conflicts:
	app/models/lab.rb
643e19f
@oleander oleander Lab must reload before #destroy is applied, due to ActiveRecord::Base…
….inverse_of
13a9065
@anjonas anjonas Remove columns lab_id, lab_group_id from extended_deadlines and add c…
…olumn lab_has_group_id
b0ca274
@anjonas anjonas Fix tests in extended_deadlines_spec.rb not passing 8c7131c
@anjonas anjonas Implement dependent destroy between lab_has_group and extended_deadl…
…ine with test #98
1364965
@anjonas anjonas Implement dependent destroy between course and given_course with test…
… close #98
b014722
@anjonas anjonas Merge branch 'master' of github.com:water/mainline into dependent-des…
…troy

Conflicts:
	spec/models/lab_spec.rb
	spec/models/student_spec.rb
a76a172
@oleander
The Water Project member

Kanske lite mycket jobb men har du lust att sammanfatta vilka modeller du har jobbat med?

Te.x
User => Student
Plockas en User bort så försvinner även Student

@jesjos
The Water Project member
jesjos commented Mar 22, 2012

+1 på @oleander

@anjonas
The Water Project member
anjonas commented Mar 22, 2012

course => given_course

lab_has_group => extended_deadline

user => administrator
user => student
user => assistant
user => examiner

assistant => assistant_registered_to_given_course

lab => lab_has_group
lab => default_deadline

lab_group => lab_has_group

given_course => assistant_registered_to_given_course
given_course => lab_group
given_course => student_registered_for_course
given_course => lab

student => student_registered_for_course

@oleander
The Water Project member

Tycker de ser bra ut. 👍 från mig.

@jesjos
The Water Project member
jesjos commented Mar 24, 2012

Ja, approved!

@oleander
The Water Project member

Jag tror inte någon annan har några invändningar. Du kan merga in koden i master, @anjonas.

@jesjos
The Water Project member
jesjos commented Mar 28, 2012

@anjonas Verkar som att vi alla är överens, du kan utföra mergen.

anjonas added some commits Mar 28, 2012
@anjonas anjonas Merge branch 'master' into dependent-destroy
Conflicts:
	app/models/assistant.rb
	app/models/lab.rb
	db/schema.rb
	spec/models/given_course_spec.rb
	spec/models/lab_group_spec.rb
	spec/models/lab_has_group_spec.rb
9c35220
@anjonas anjonas Change in dependent destroy test 035a5d4
@anjonas
The Water Project member
anjonas commented Mar 28, 2012

Sådär nu har jag mergat in master in i dependent-destroy, och när jag kör testerna så misslyckas dependent-destroy på User. Exempel:

User dependent destroy should not be possible for a student to exist without a user
     Failure/Error: user.destroy
     ActiveRecord::StatementInvalid:
       PG::Error: ERROR:  column repositories.owner_id does not exist
       LINE 1: ...ELECT "repositories".* FROM "repositories"  WHERE "repositor...
                                                                    ^
       : SELECT "repositories".* FROM "repositories"  WHERE "repositories"."owner_id" = 14 AND "repositories"."owner_type" = 'User'

De andra misslyckade testerna ger samma felmeddelande. Någon som har en ide om vad som är fel?

@oleander
The Water Project member

@anjonas Du får ta och pusha upp din kod.

@anjonas anjonas merged commit 250e5c2 into master Mar 29, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.