Giter Club home page Giter Club logo

carrierwave-neo4j's Introduction

CarrierWave for ActiveGraph

This gem adds support for Neo4j 3.0+ (neo4j.rb 9.6.0+) to CarrierWave 2.1.0+, see the CarrierWave documentation for more detailed usage instructions.

Installation Instructions

Add to your Gemfile:

gem 'carrierwave-neo4j', '~> 3.0', require: 'carrierwave/active_graph'

You can see example usage in spec/active_graph_realistic_spec.rb but in brief, you can use it like this:

class AttachmentUploader < CarrierWave::Uploader::Base
  storage :file

  def store_dir
    "uploads/#{model.class.to_s.underscore}/#{mounted_as}/#{model.id}"
  end
end

class Asset
  include ActiveGraph::Node

  property :attachment, type: String
  mount_uploader :attachment, AttachmentUploader
end

If you want image manipulation, you will need to install ImageMagick

On Ubuntu:

sudo apt-get install imagemagick --fix-missing

On macOS:

brew install imagemagick

Development

bundle install
rake neo4j:install[community-4.0.11,test]
rake neo4j:start[test]
rake spec

Troubleshooting

Files are nil

If you aren't getting your files back after querying a record from Neo4j, be aware that this will only happen automatically for the Model#find method. For all other finders (#all, #first, #find_by, #find_by_*, #find_by_*!, #last) you will need to force a reload so the model sees the file. For example:

users = User.all
users.each(&:reload_from_database!)

Sorry, this sucks. But this is a limitation of Neo4j.rb as these other finders don't fire any callbacks.

binstubs (particularly bin/rspec) seem broken

If you're getting some infinite recursion when you run the specs that ultimately results in an error like:

`ensure in require': CRITICAL: RUBYGEMS_ACTIVATION_MONITOR.owned?: before false -> after true (RuntimeError)

You may want to try:

rm .bundle/config
bundle install

carrierwave-neo4j's People

Contributors

amitsuryavanshi avatar cheerfulstoic avatar deobald avatar dpisarewski avatar edenvicary avatar hng avatar janbiedermann avatar reu avatar subvertallchris avatar

Watchers

 avatar

Forkers

weedyseadragon

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.