#rubyonrails - Wed 9 May 2007 between 00:00 and 00:20

NY Lost Funds



mrturtleI have a boolean attribute in one model that has a belongs_to relationship. When I do Person.find(1).father.temporary, I get false (which is wrong)
when I try Person.find(26).temporary, I get true (26 is the father's ID)
Any Ideas?
chjuniormrturtle, what is wrong with this? @revendedor.ramos_atividade << RamoAtividade.create(:nome => r, :creado_por => @revendedor.codigo_cliente) unless r.blank?
orsonorkhello
who wants free ruby on rails hosting?
therealcr0bari want free colo
chjuniororsonork, hum.... me =)
orsonorki can give you space on my server
chjuniororsonork, with DNS ?
orsonorka subdomain
mrturtleIf it's a has_many relationship (which it looks like it is since you're using a <<) I think you want to pluralize the association: @revendedor.ramos_atividades << RamoAtividade.create(:nome => r, :creado_por => @revendedor.codigo_cliente) unless r.blank?
orsonorkmrturtle: do you talk in spanish?
mrturtle: hola
chjuniormrturtle, well..... it's a has_and_belongs_to_many association =/
macographerthe pluralization of habtm relationships is kind of tricky
or rather, it wasn't obvious to me.
but it's important.
mrturtleun poco. No practicar mucho pero quiero usarlo mas
macographerwhat is your join table called, chjunior .
chjuniormacographer, mrturtle: I dislike pluralization cause I'm brazilian and my code is in portuguese, my tables and columns too, so I always turns it off.... in this project it's not different
mrturtlehmm...i'm not sure if I can help if you've customized stuff.
macographermy habtm relationship was fixed as soon as i pluralized things correctly.
i followed that example in the wiki, and had everything correct except the pluralization of the join table, if i remember correctly.
therealcr0bardo I need to do anything special if I developed an app with rails 1.1.6 and then installed 1.2.3
macographermy guess is that rails needs the pluralization to do all of the automagical things related to the habtm relationship.
therealcr0barwhen I update RAILS_GEM_VERSION i get all sorts of weird errors when I try to run a console
macographerchjunior: you know you can customize the pluralization of words, right?
chjunior: have you tried doing a has_many :through relationship instead?
chjuniormacographer, mrturtle: look this: http://paste.milk-it.net/321
macographer, I know, but it's really not necessary
macographer?
chjuniormacographer, what?
macographeri don't understand.
chjuniormacographer, witch part?
macographerwhat's not working?
orsonorkok, another try: free ruby on rails hosting - no ads, 200 MB disk space, 1 GB bandwidth, shell access, rails 1.2.2, 1 mysql db, php5, perl & python
contact me now webmaster@zonarails.com
chjuniormacographer, well, the generated SQL is completely wrong.... cause it's not adding the fields....
tpopefeh, why not 1.2.3?

Page: 2 9 16 23 30 37 44 51 58 65 72 79 86 93 100 107 

IrcArchive

NY Lost Funds