#rubyonrails - Sun 4 Mar 2007 between 16:42 and 16:55

NY Lost Funds



jeremydurhamcoder2000: create_table(:suppliers, :options => 'ENGINE=InnoDB DEFAULT CHARSET=utf8')
coder2000: from the docs to create a innodb table; that does of course make your migration mysql specific
coder2000yeah. any performance enhancement from innodb over myisam? besides transactions?
djsmacedocoder2000: and to use special chars in html? use, for example, ã?
rabbit7hey there i have a problem with sqlite db. i can read it but i cant write it
jeremydurhamcoder2000: depends on if your read-sentric or write-sentric
djsmacedoany brazilian here?
rabbit7permissions are 777
on the db file
coder2000jeremydurham: ic. Well I think that the test framework should be written to work the way its advertised whether the db supports rollbacks or not.
jeremydurhamI don't make the rules, I just play by them :)
dmnsheldonh i tried doing this in the model - no matter how i code it - it doesn't work at all
sheldonh does something like this make sense ? self.attribute_names.each { |field| if field.blank?; self.field = nil end}
coder2000I know. but if one of the rules states that all tests start with a clean db then it should do that without requireing extra features from the db
dmnsheldonh inside a before_save
sheldonhdmn: i _really_ think it's ill-advised to not be explicit about this
dmn: i would override the foo= methods where it actually matters
halorgiumdmn: you are iterating over the attribute_names ...
dmnsheldonh it matters for all the fields
sheldonh i don't allow empty values
sheldonhdmn: and all fields are strings?
dmnin thios model - 90%
oh
i see the point
;]
sheldonhdmn: then why don't you just validates_presence_of ?
entiesheldonh, jeremydurham: thanks base 64 is exactly that i needed to fix it
rabbit7works now.. the directory must be writeable too
dmnsheldonh the don't need to be present
sheldonhdmn: they can be nil, but not blank
dmnright.
sheldonhdmn: so i'd do stuff like def foo=(new_foo); write_attribute("foo", new_foo.blank? ? nil : new_foo); end
djsmacedoany brazilian here?
sheldonhdmn: which i'm sure you could dry out
dmn: now, back to why your before_save didn't work
dmn: you said attribute_names, which means you had to do write_attribute(field, nil)
dmnahm
ok, i'll try to dry this stuff ;]
sheldonhdmn: and of course, field.blank? would never return true
dmn: because field is actually an attribute name. so you probably wanted read_attribute(field).blank?

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

IrcArchive

NY Lost Funds