public
Created

Integrating neo4j with Dragonfly in Rails

  • Download Gist
document.rb
Ruby
1 2 3 4 5
class Document < Neo4j::Model
property :file_uid, :type => String
property :file_name, :type => String
file_accessor :file
end
dragonfly.rb
Ruby
1 2 3 4 5 6 7 8 9
# 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

awesome, did not know about dragenfly

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

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.