#rubyonrails - Sun 8 Apr 2007 between 13:52 and 14:22

NY Lost Funds



zapnappstickne_: hrmm yeah might be the way i'm chaining model dependencies. hold on lemme review.
actionpstickne_ wanders off
pstickne_wanders off
pZYchOpstickne_: same problem
zapnapmaybe that's invoked by validates_associated??
pZYchOpstickne_: INSERT INTO inventory_items ("description2", "dimension_unit", "visible", "weight_per_meter", "inventory_number", "group_number", "price", "weight", "remark", "weight_unit", "bin_location", "length", "value", "height", "tuev", "description1", "width") VALUES('1', '1', 't', 1, NULL, '123', 1, 1, '1', '1', '1', 1, 1, 1, '2007-04-08', '1', 1)
zapnapbecause there's no explicit call to article.valid?
cardioidzapnap: It's invoked by validates_associated
pZYchOpstickne_: but the inventory_number should not be set in the statement
zapnapcardioid: excellent, exactly what i was looking for. thanks.
cardioidpZYchO: Is it really a problem? A trigger could overwrite the null value
pZYchOcardioid: well, it's not a real trigger, it's a serial field... sorry for that misleading information
cardioidIf it is a problem, you'd have to alter the insert statement to not give anything for that column
pZYchOcardioid: so the default value is set to a sequence...
cardioid: that's what I'm trying to do ;) I'm looking for a way to tell rails not to touch the field ;)
cardioidYou could look into a plugin like acts_as_changed
pZYchOcardioid: Specifies only the changed fields when updating the database record....... that's not what I'm looking for, is it?
cardioidIt'll help with what you're doing. You don't change the value of inventory_number when you create the object, so it won't be present in the insert statement.
pZYchOcardioid: but it's a new value so it should be marked as changed?!
cardioidUh, no
pZYchOok
cardioidWhat acts_as_changed does is keep track of every attribute that has been specified since object creation or database load. Then, when it creates the insert or update statement, it only uses those columns, not all of them.
is "inventory_number" the primary key of that table?
VadimZhi to all
i need help for a project
pZYchOhi
cardioid: it isn't, id is the primary key... but inventory_item must be an auto increment, too
Michael_Boutroshey VadimZ, what's up?
sTbhow can i set <%= yield :secondary %> ?
leethalstb: content_for :secondary, I guess
sTbhmmm k ty
Michael_BoutrosWhat does <%=h blah blah %> do?
I assume the h escapes all HTMl characters?
cschneidthe h() function sanitizes html characters
Michael_BoutrosAnd it should be used all the time right?
actionMichael_Boutros still hates rails inconsistencies.
Michael_Boutrosstill hates rails inconsistencies.
sTbi have cms_controller.rb and project_controller.rb; default layout is application.rhtml;default route is to cms/showid/1; i also want to inlclude project/list2 (little table of my latest work) at application.rhtml even when the url is cms/..../... how can i "include/render" the project/list2 "output/render" into application.rhtml no matter what url/controller is called?
Michael_BoutrosHmm..
Can a form be displayed and then the info sent to the DB in one method?
VadimZDear Developers! Ho is interested in development a Social Network Platform?
sTbVadimZ who is ho? :>

Page: 3 10 17 24 31 38 45 52 59 66 73 80 

IrcArchive

NY Lost Funds