Skip to content

Instantly share code, notes, and snippets.

@ravicious
Created June 14, 2009 09:02
Show Gist options
  • Save ravicious/129613 to your computer and use it in GitHub Desktop.
Save ravicious/129613 to your computer and use it in GitHub Desktop.
# Do metody comments_update jest przekazywany cały obiekt [comments_update(status)].
comment = status.comments.build(
:author => messages[msg]['user_path'].gsub(/\/users\//, ''),
:body => messages[msg]['body'],
:created_at => messages[msg]['created_at']
)
comment.id = messages[msg]['id']
if Comment.exists?(messages[msg]['id'])
comment.destroy
else
comment.save
end
>> status = Status.find_by_id(10527360)
=> #<Status id: 10527360, author: "pecet" i tak dalej...
>> status.comments
ActiveRecord::StatementInvalid: SQLite3::SQLException: no such column: comments.status_id:
SELECT * FROM "comments" WHERE ("comments".status_id = 10527360)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment