Skip to content

Instantly share code, notes, and snippets.

@carolyncole
Created January 13, 2016 14:34
Show Gist options
  • Save carolyncole/6f43908cf7829601ab78 to your computer and use it in GitHub Desktop.
Save carolyncole/6f43908cf7829601ab78 to your computer and use it in GitHub Desktop.
Changing the content of a file
gf = GenericFile.find("abc123")
file = File.open("file name")
content = file.read
gf.content.content = content
gf.create_derivatives
gf.visibility = "open"
gf.save
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment