nice_nodes 1.0.0.pre
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/nice_nodes.rb +47 -0
- metadata +63 -0
data/lib/nice_nodes.rb
ADDED
@@ -0,0 +1,47 @@
|
|
1
|
+
# nice_nodes.rb
|
2
|
+
require 'neo4j'
|
3
|
+
|
4
|
+
class Model < Neo4j::Rails::Model
|
5
|
+
include Neo4j::Rails::Versioning
|
6
|
+
property :created_at
|
7
|
+
property :updated_at
|
8
|
+
end
|
9
|
+
|
10
|
+
class Relationship < Neo4j::Rails::Relationship
|
11
|
+
property :created_at
|
12
|
+
property :updated_at
|
13
|
+
end
|
14
|
+
|
15
|
+
M, R = Model, Relationship
|
16
|
+
Rel = Relationship
|
17
|
+
|
18
|
+
# -----------------------------------------------------------------------------------
|
19
|
+
#
|
20
|
+
# 'agendo_neo4j_rails_helpers.rb'
|
21
|
+
# Pre-configured 'Model' and 'Relationship' base objects.
|
22
|
+
#
|
23
|
+
# Inherit from 'Model' or 'Relationship' instead of Neo4j::Rails::Model/Relationship
|
24
|
+
# %w(Model Relationship).each do |type|
|
25
|
+
# klass = "Neo4j::Rails::#{type}".constantize
|
26
|
+
# Object.const_set(type, Class.new(klass) do
|
27
|
+
# include ActiveModel::ForbiddenAttributesProtection
|
28
|
+
# property :created_at
|
29
|
+
# property :updated_at
|
30
|
+
# end)
|
31
|
+
# end
|
32
|
+
#
|
33
|
+
# class Controller < ApplicationController
|
34
|
+
# private
|
35
|
+
# # Controllers auto-do the pre-configuered strong parameters
|
36
|
+
# def self.inherited(subclass)
|
37
|
+
# subklass = subclass.to_s.gsub("Controller","").downcase
|
38
|
+
# method = subklass + "_param"
|
39
|
+
# subklass.constantize.send(:define_method, method.to_sym) do |m|
|
40
|
+
# params.require(subklass.to_sym).permit!
|
41
|
+
# end
|
42
|
+
#
|
43
|
+
# # TODO: include override guidance via commented code injection
|
44
|
+
# end
|
45
|
+
# end
|
46
|
+
#
|
47
|
+
# -----------------------------------------------------------------------------------
|
metadata
ADDED
@@ -0,0 +1,63 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: nice_nodes
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
prerelease: 6
|
5
|
+
version: 1.0.0.pre
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Ethan Stillman
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2013-03-08 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: neo4j
|
16
|
+
version_requirements: !ruby/object:Gem::Requirement
|
17
|
+
requirements:
|
18
|
+
- - "~>"
|
19
|
+
- !ruby/object:Gem::Version
|
20
|
+
version: '2.0'
|
21
|
+
none: false
|
22
|
+
requirement: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '2.0'
|
27
|
+
none: false
|
28
|
+
prerelease: false
|
29
|
+
type: :runtime
|
30
|
+
description: nice_nodes provides 'Model' and 'Relationship' helpers to make developing with Neo4j more enjoyable.
|
31
|
+
email: ehs.stillman@gmail.com
|
32
|
+
executables: []
|
33
|
+
extensions: []
|
34
|
+
extra_rdoc_files: []
|
35
|
+
files:
|
36
|
+
- lib/nice_nodes.rb
|
37
|
+
homepage: http://github.com/estill01/nice_nodes
|
38
|
+
licenses: []
|
39
|
+
post_install_message:
|
40
|
+
rdoc_options: []
|
41
|
+
require_paths:
|
42
|
+
- lib
|
43
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: !binary |-
|
48
|
+
MA==
|
49
|
+
none: false
|
50
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - !binary |-
|
53
|
+
Pg==
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: 1.3.1
|
56
|
+
none: false
|
57
|
+
requirements: []
|
58
|
+
rubyforge_project:
|
59
|
+
rubygems_version: 1.8.24
|
60
|
+
signing_key:
|
61
|
+
specification_version: 3
|
62
|
+
summary: Little helpers for using Neo4j with Rails.
|
63
|
+
test_files: []
|