Created
June 14, 2009 09:02
-
-
Save ravicious/129613 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>> 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