This is a beginner-ish question, I know, but I can’t seem to find
example code anywhere that resembles what I’m doing. The line I can’t
get working is this:
@comments = Comment.update @params['comments'].keys, :status =>
status
status has been set to the string ‘approve’, and
@params[‘comments’].keys returns a list of valid ids, but when I run the
code, I get this in my logs:
Comment Load (0.004792) SELECT * FROM comments WHERE comments.id =
‘2’ LIMIT 1
SQL (0.000320) BEGIN
Comment Columns (0.000637) SHOW FIELDS FROM comments
Comment Update (0.000752) UPDATE comments SET date
= ‘2005-10-30
18:29:11’, comment
= ‘something else’, status
= ‘moderate’,
user_id
= 1, post_id
= 1 WHERE id = 2
SQL (0.000266) COMMIT
In other words, it’s ignoring the ‘:status => status’ argument. I
suspect I’m messing up the syntax, but reading through the
ActiveRecord::Base source doesn’t give me any tips on how to do it
properly. Any suggestions?
Joel