Created
May 20, 2009 16:14
-
-
Save jashkenas/114916 to your computer and use it in GitHub Desktop.
This file contains 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
# This method will be called on any create or update, and should be the central | |
# clearing house for data processing and conversion. | |
def request_update_attributes(data, user=User.current, instance_id=ZenbeInstance.current) | |
instance_id ||= 'NO_INSTANCE_ID' | |
return false unless self.accessible_to?(user) | |
self.process_files(data) | |
self.process_embedded_urls(data) | |
self.update_attributes(data) | |
self.set_post_type | |
self.try_to_scribd_attachments | |
self.broadcast(User.current, ZenbeInstance.current, { | |
"channels" => [{"id" => self.channel.uuid, "name" => self.channel.name, "updated_at" => Time.now.utc}], | |
"posts" => [self.json_ready_hash] | |
}) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment