| carterparks | including capistrano eck they're pricy though 256mb memory, 10gb storage, 1000gb transfer = $75/month |
| eventualbuddha | azta: on questions |
| azta | eventualbuddha: so I add an answer_id to questions, and question_id on answers? |
| coder2000 | azta: no just an answer_id to questions |
| azta | coder2000: I'm wanting to also say Question has_one :correct_answer, :class_name => "Answer" |
| Rodrig0 | do dreamhost rails solution is one of the worst? |
| coder2000 | yes it is azta: yes, it is still the answer_id on question unless you get errors it might actually be the other way around but its only on one table |
| eventualbuddha | azta: you need question_id on answers, and correct_answer_id on questions |
| azta | eventualbuddha: ok, thanks |
| eventualbuddha | an alternative (and perhaps better) solution is to use a boolean field on answers (e.g. t.column :correct, :boolean) |
| azta | eventualbuddha: true, I'm just playing around though, trying to work out how the associations worked :) |
| christophe971 | aaaar |
| dnite | coder2000, i used it for a short period of time. seemed a little too 'closed' to me. i dunno. i found slicehost thou and love it. |
| christophe971 | if i call a method of my model (which contain an errors.add) from my controller, why does it don't add the error ? |
| dasil003 | how do you test multipart forms... i have a sample file I want to use and I made a 'test/files' directory where it's stored. How do I put that in the post request in functional testing? |
| azta | eventualbuddha: http://pastie.caboo.se/44692 this doesn't work |
| eventualbuddha | azta: like i said, you may have to specify the fk explicitly, like so: has_one :correct_answer, :class_name => 'Answer', :foreign_key => 'correct_answer_id' |
| azta | the correct_answer_id never gets anything put in it. I can say q = Question.create, then q.correct_answer = Answer.create.. looks fine, works in console, q.correct_answer shows the answer, but it's not saved eventualbuddha: then it looks for correct_answer_id in answers |
| eventualbuddha | azta: oh right. belongs_to, not has_one |
| azta | right, Q hm :answers, A bt :q |
| omninerd | is there anything in Rails that will make the decision to use "a" vs. "an"? |
| eventualbuddha | azta: no, also Q bt :ca omninerd: i don't think so, but if there is it'd be in inflector and/or text_helper |
| omninerd | ok, thanks |
| azta | eventualbuddha: class Question < ActiveRecord::Base \n has_one :correct_answer, :class_name => "Answer" \n belongs_to :correct_answer, :class_name => "Answer", :foreign_key => "correct_answer_id" end ? |
| eventualbuddha | azta: omit the whole has_one line |
| azta | ah thanks eventualbuddha. Makes more sense now. "A question belongs to a correct answer". That really doesn't read very nicely :) thats why I was trying to shoehorn "A question has one correct answer" into rails I guess I would have to create a correct_answers to make it read nice. Or use STI to have an answers/correct_answers ? |