Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixed saving and reloading after recent changes
- Loading branch information
1 parent
adca4dd
commit ab1b68c
Showing
3 changed files
with
51 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
## CarrierWave for Neo4j | ||
|
||
This gem adds support for Neo4j to CarrierWave, see the CarrierWave documentation for more detailed usage instructions. | ||
|
||
### Installation Instructions | ||
|
||
Add to your Gemfile: | ||
|
||
```ruby | ||
gem 'carrierwave-neo4j', require: 'carrierwave/neo4j', github: 'dpisarewski/carrierwave-neo4j' | ||
``` | ||
Use it like this: | ||
|
||
```ruby | ||
class Asset | ||
include Neo4j::ActiveNode | ||
extend CarrierWave::Neo4j | ||
|
||
property :attachment, type: String | ||
mount_uploader :attachment, AttachmentUploader | ||
end | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
module Neo4j::Shared | ||
module TypeConverters | ||
class UploaderConverter | ||
class << self | ||
def convert_type | ||
::CarrierWave::Uploader::Base | ||
end | ||
|
||
def to_db(value) | ||
value.identifier | ||
end | ||
|
||
def to_ruby(value) | ||
value | ||
end | ||
end | ||
end | ||
end | ||
end |