Skip to content

Instantly share code, notes, and snippets.

@jakubstraka
Created January 29, 2015 14:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jakubstraka/b3e0ca23fa62f17aa927 to your computer and use it in GitHub Desktop.
Save jakubstraka/b3e0ca23fa62f17aa927 to your computer and use it in GitHub Desktop.
# in web_module.rb
field :attachment_id, type: BSON::ObjectId
def attachment
Attachment.find(attachment_id)
end
# then you can try
@module.attachment.update(name: 'new one')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment