Skip to content

Instantly share code, notes, and snippets.

@dnagir
Created December 12, 2011 05:25
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 dnagir/1465139 to your computer and use it in GitHub Desktop.
Save dnagir/1465139 to your computer and use it in GitHub Desktop.
Integrating neo4j with Dragonfly in Rails
class Document < Neo4j::Model
property :file_uid, :type => String
property :file_name, :type => String
file_accessor :file
end
# config/initializers/dragonfly.rb
require 'dragonfly/rails/images'
# Make the macro available for neo4j
# https://github.com/markevans/dragonfly/blob/master/lib/dragonfly/rails/images.rb
Dragonfly[:images].tap do |app|
app.define_macro(Neo4j::Model, :image_accessor)
app.define_macro(Neo4j::Model, :file_accessor)
end
@andreasronge
Copy link

awesome, did not know about dragenfly

@dnagir
Copy link
Author

dnagir commented Dec 12, 2011

I sometimes prefer it over CarrierWave when I need more flexibility with resizing/processing images rather than fast static images.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment