neoid 0.1.2 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/LICENSE +1 -1
- data/README.md +27 -25
- data/Rakefile +2 -2
- data/lib/neoid.rb +74 -61
- data/lib/neoid/batch.rb +27 -27
- data/lib/neoid/database_cleaner.rb +1 -1
- data/lib/neoid/middleware.rb +1 -1
- data/lib/neoid/model_additions.rb +13 -11
- data/lib/neoid/model_config.rb +13 -13
- data/lib/neoid/node.rb +21 -21
- data/lib/neoid/railtie.rb +1 -1
- data/lib/neoid/relationship.rb +78 -78
- data/lib/neoid/search_session.rb +3 -3
- data/lib/neoid/version.rb +1 -1
- data/spec/factories.rb +12 -0
- data/spec/neoid/batch_spec.rb +68 -89
- data/spec/neoid/config_spec.rb +6 -6
- data/spec/neoid/model_config_spec.rb +14 -13
- data/spec/neoid/node_spec.rb +60 -79
- data/spec/neoid/relationship_spec.rb +39 -37
- data/spec/neoid/search_spec.rb +71 -46
- data/spec/neoid_spec.rb +11 -4
- data/spec/spec_helper.rb +23 -4
- data/spec/support/database.yml +1 -1
- data/spec/support/models.rb +16 -16
- data/spec/support/schema.rb +1 -2
- metadata +84 -31
- data/.gitignore +0 -5
- data/.rspec +0 -1
- data/.travis.yml +0 -4
- data/CHANGELOG.md +0 -58
- data/Gemfile +0 -4
- data/TODO.md +0 -4
- data/neoid.gemspec +0 -28
data/spec/support/schema.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
ActiveRecord::Schema.define :
|
1
|
+
ActiveRecord::Schema.define version: 0 do
|
2
2
|
create_table :users do |t|
|
3
3
|
t.string :name
|
4
4
|
t.string :slug
|
@@ -22,7 +22,6 @@ ActiveRecord::Schema.define :version => 0 do
|
|
22
22
|
t.timestamps
|
23
23
|
end
|
24
24
|
|
25
|
-
|
26
25
|
create_table :articles do |t|
|
27
26
|
t.string :title
|
28
27
|
t.string :body
|
metadata
CHANGED
@@ -1,20 +1,19 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: neoid
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
5
|
-
prerelease:
|
4
|
+
version: 0.2.0
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
7
|
+
- Ben Morgan
|
8
8
|
- Elad Ossadon
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2014-06-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
17
|
requirements:
|
19
18
|
- - ! '>='
|
20
19
|
- !ruby/object:Gem::Version
|
@@ -22,7 +21,20 @@ dependencies:
|
|
22
21
|
type: :development
|
23
22
|
prerelease: false
|
24
23
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
|
24
|
+
requirements:
|
25
|
+
- - ! '>='
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
version: '0'
|
28
|
+
- !ruby/object:Gem::Dependency
|
29
|
+
name: pry
|
30
|
+
requirement: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - ! '>='
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: '0'
|
35
|
+
type: :development
|
36
|
+
prerelease: false
|
37
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
38
|
requirements:
|
27
39
|
- - ! '>='
|
28
40
|
- !ruby/object:Gem::Version
|
@@ -30,7 +42,6 @@ dependencies:
|
|
30
42
|
- !ruby/object:Gem::Dependency
|
31
43
|
name: rspec
|
32
44
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
45
|
requirements:
|
35
46
|
- - ! '>='
|
36
47
|
- !ruby/object:Gem::Version
|
@@ -38,7 +49,6 @@ dependencies:
|
|
38
49
|
type: :development
|
39
50
|
prerelease: false
|
40
51
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
52
|
requirements:
|
43
53
|
- - ! '>='
|
44
54
|
- !ruby/object:Gem::Version
|
@@ -46,7 +56,6 @@ dependencies:
|
|
46
56
|
- !ruby/object:Gem::Dependency
|
47
57
|
name: rest-client
|
48
58
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
59
|
requirements:
|
51
60
|
- - ! '>='
|
52
61
|
- !ruby/object:Gem::Version
|
@@ -54,7 +63,6 @@ dependencies:
|
|
54
63
|
type: :development
|
55
64
|
prerelease: false
|
56
65
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
66
|
requirements:
|
59
67
|
- - ! '>='
|
60
68
|
- !ruby/object:Gem::Version
|
@@ -62,7 +70,6 @@ dependencies:
|
|
62
70
|
- !ruby/object:Gem::Dependency
|
63
71
|
name: activerecord
|
64
72
|
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
73
|
requirements:
|
67
74
|
- - ! '>='
|
68
75
|
- !ruby/object:Gem::Version
|
@@ -70,7 +77,6 @@ dependencies:
|
|
70
77
|
type: :development
|
71
78
|
prerelease: false
|
72
79
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
80
|
requirements:
|
75
81
|
- - ! '>='
|
76
82
|
- !ruby/object:Gem::Version
|
@@ -78,7 +84,6 @@ dependencies:
|
|
78
84
|
- !ruby/object:Gem::Dependency
|
79
85
|
name: sqlite3
|
80
86
|
requirement: !ruby/object:Gem::Requirement
|
81
|
-
none: false
|
82
87
|
requirements:
|
83
88
|
- - ! '>='
|
84
89
|
- !ruby/object:Gem::Version
|
@@ -86,7 +91,62 @@ dependencies:
|
|
86
91
|
type: :development
|
87
92
|
prerelease: false
|
88
93
|
version_requirements: !ruby/object:Gem::Requirement
|
89
|
-
|
94
|
+
requirements:
|
95
|
+
- - ! '>='
|
96
|
+
- !ruby/object:Gem::Version
|
97
|
+
version: '0'
|
98
|
+
- !ruby/object:Gem::Dependency
|
99
|
+
name: simplecov
|
100
|
+
requirement: !ruby/object:Gem::Requirement
|
101
|
+
requirements:
|
102
|
+
- - ! '>='
|
103
|
+
- !ruby/object:Gem::Version
|
104
|
+
version: '0'
|
105
|
+
type: :development
|
106
|
+
prerelease: false
|
107
|
+
version_requirements: !ruby/object:Gem::Requirement
|
108
|
+
requirements:
|
109
|
+
- - ! '>='
|
110
|
+
- !ruby/object:Gem::Version
|
111
|
+
version: '0'
|
112
|
+
- !ruby/object:Gem::Dependency
|
113
|
+
name: codeclimate-test-reporter
|
114
|
+
requirement: !ruby/object:Gem::Requirement
|
115
|
+
requirements:
|
116
|
+
- - ! '>='
|
117
|
+
- !ruby/object:Gem::Version
|
118
|
+
version: '0'
|
119
|
+
type: :development
|
120
|
+
prerelease: false
|
121
|
+
version_requirements: !ruby/object:Gem::Requirement
|
122
|
+
requirements:
|
123
|
+
- - ! '>='
|
124
|
+
- !ruby/object:Gem::Version
|
125
|
+
version: '0'
|
126
|
+
- !ruby/object:Gem::Dependency
|
127
|
+
name: rspec-its
|
128
|
+
requirement: !ruby/object:Gem::Requirement
|
129
|
+
requirements:
|
130
|
+
- - ! '>='
|
131
|
+
- !ruby/object:Gem::Version
|
132
|
+
version: '0'
|
133
|
+
type: :development
|
134
|
+
prerelease: false
|
135
|
+
version_requirements: !ruby/object:Gem::Requirement
|
136
|
+
requirements:
|
137
|
+
- - ! '>='
|
138
|
+
- !ruby/object:Gem::Version
|
139
|
+
version: '0'
|
140
|
+
- !ruby/object:Gem::Dependency
|
141
|
+
name: factory_girl
|
142
|
+
requirement: !ruby/object:Gem::Requirement
|
143
|
+
requirements:
|
144
|
+
- - ! '>='
|
145
|
+
- !ruby/object:Gem::Version
|
146
|
+
version: '0'
|
147
|
+
type: :development
|
148
|
+
prerelease: false
|
149
|
+
version_requirements: !ruby/object:Gem::Requirement
|
90
150
|
requirements:
|
91
151
|
- - ! '>='
|
92
152
|
- !ruby/object:Gem::Version
|
@@ -94,7 +154,6 @@ dependencies:
|
|
94
154
|
- !ruby/object:Gem::Dependency
|
95
155
|
name: neography
|
96
156
|
requirement: !ruby/object:Gem::Requirement
|
97
|
-
none: false
|
98
157
|
requirements:
|
99
158
|
- - ! '>='
|
100
159
|
- !ruby/object:Gem::Version
|
@@ -102,28 +161,22 @@ dependencies:
|
|
102
161
|
type: :runtime
|
103
162
|
prerelease: false
|
104
163
|
version_requirements: !ruby/object:Gem::Requirement
|
105
|
-
none: false
|
106
164
|
requirements:
|
107
165
|
- - ! '>='
|
108
166
|
- !ruby/object:Gem::Version
|
109
167
|
version: '0'
|
110
168
|
description: Extend Ruby on Rails ActiveRecord with Neo4j nodes. Keep RDBMS and utilize
|
111
|
-
the power of Neo4j queries
|
169
|
+
the power of Neo4j queries. Originally by @elado.
|
112
170
|
email:
|
171
|
+
- ben@benmorgan.io
|
113
172
|
- elad@ossadon.com
|
114
173
|
executables: []
|
115
174
|
extensions: []
|
116
175
|
extra_rdoc_files: []
|
117
176
|
files:
|
118
|
-
- .gitignore
|
119
|
-
- .rspec
|
120
|
-
- .travis.yml
|
121
|
-
- CHANGELOG.md
|
122
|
-
- Gemfile
|
123
177
|
- LICENSE
|
124
178
|
- README.md
|
125
179
|
- Rakefile
|
126
|
-
- TODO.md
|
127
180
|
- lib/neoid.rb
|
128
181
|
- lib/neoid/batch.rb
|
129
182
|
- lib/neoid/config.rb
|
@@ -136,7 +189,7 @@ files:
|
|
136
189
|
- lib/neoid/relationship.rb
|
137
190
|
- lib/neoid/search_session.rb
|
138
191
|
- lib/neoid/version.rb
|
139
|
-
-
|
192
|
+
- spec/factories.rb
|
140
193
|
- spec/neoid/batch_spec.rb
|
141
194
|
- spec/neoid/config_spec.rb
|
142
195
|
- spec/neoid/model_config_spec.rb
|
@@ -148,31 +201,32 @@ files:
|
|
148
201
|
- spec/support/database.yml
|
149
202
|
- spec/support/models.rb
|
150
203
|
- spec/support/schema.rb
|
151
|
-
homepage:
|
152
|
-
licenses:
|
204
|
+
homepage: https://github.com/neoid-gem/neoid
|
205
|
+
licenses:
|
206
|
+
- MIT
|
207
|
+
metadata: {}
|
153
208
|
post_install_message:
|
154
209
|
rdoc_options: []
|
155
210
|
require_paths:
|
156
211
|
- lib
|
157
212
|
required_ruby_version: !ruby/object:Gem::Requirement
|
158
|
-
none: false
|
159
213
|
requirements:
|
160
214
|
- - ! '>='
|
161
215
|
- !ruby/object:Gem::Version
|
162
216
|
version: '0'
|
163
217
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
164
|
-
none: false
|
165
218
|
requirements:
|
166
219
|
- - ! '>='
|
167
220
|
- !ruby/object:Gem::Version
|
168
221
|
version: '0'
|
169
222
|
requirements: []
|
170
|
-
rubyforge_project:
|
171
|
-
rubygems_version:
|
223
|
+
rubyforge_project:
|
224
|
+
rubygems_version: 2.3.0
|
172
225
|
signing_key:
|
173
|
-
specification_version:
|
226
|
+
specification_version: 4
|
174
227
|
summary: Neo4j for ActiveRecord
|
175
228
|
test_files:
|
229
|
+
- spec/factories.rb
|
176
230
|
- spec/neoid/batch_spec.rb
|
177
231
|
- spec/neoid/config_spec.rb
|
178
232
|
- spec/neoid/model_config_spec.rb
|
@@ -184,4 +238,3 @@ test_files:
|
|
184
238
|
- spec/support/database.yml
|
185
239
|
- spec/support/models.rb
|
186
240
|
- spec/support/schema.rb
|
187
|
-
has_rdoc:
|
data/.gitignore
DELETED
data/.rspec
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
--color
|
data/.travis.yml
DELETED
data/CHANGELOG.md
DELETED
@@ -1,58 +0,0 @@
|
|
1
|
-
## v0.1.1
|
2
|
-
|
3
|
-
* Added batch support, for much faster intiialization of current DB or reindexing all DB.
|
4
|
-
* Dropped indexes per model, instead, using `node_auto_index` and `relationship_auto_index`, letting Neo4j auto index objects.
|
5
|
-
* One `neo_save` method instead of `neo_create` and `neo_update`. It takes care of inserting or updating.
|
6
|
-
|
7
|
-
### Breaking changes:
|
8
|
-
|
9
|
-
Model indexes (such as `users_index`) are now turned off by default. Instead, Neoid uses Neo4j's auto indexing feature.
|
10
|
-
|
11
|
-
In order to have the model indexes back, use this in your configuration:
|
12
|
-
|
13
|
-
```ruby
|
14
|
-
Neoid.configure do |c|
|
15
|
-
c.enable_per_model_indexes = true
|
16
|
-
end
|
17
|
-
```
|
18
|
-
|
19
|
-
This will turn on for all models.
|
20
|
-
|
21
|
-
You can turn off for a specific model with:
|
22
|
-
|
23
|
-
```ruby
|
24
|
-
class User < ActiveRecord::Base
|
25
|
-
include Neoid::Node
|
26
|
-
|
27
|
-
neoidable enable_model_index: false do |c|
|
28
|
-
end
|
29
|
-
end
|
30
|
-
```
|
31
|
-
|
32
|
-
## v0.0.51
|
33
|
-
|
34
|
-
* Releasing Neoid as a gem.
|
35
|
-
|
36
|
-
## v0.0.41
|
37
|
-
|
38
|
-
* fixed really annoying bug caused by Rails design -- Rails doesn't call `after_destroy` when assigning many to many relationships to a model, like `user.movies = [m1, m2, m3]` or `user.update_attributes(params[:user])` where it contains `params[:user][:movie_ids]` list (say from checkboxes), but it DOES CALL after_create for the new relationships. the fix adds after_remove callback to the has_many relationships, ensuring neo4j is up to date with all changes, no matter how they were committed
|
39
|
-
|
40
|
-
## v0.0.4
|
41
|
-
|
42
|
-
* rewrote seacrch. one index for all types instead of one for type. please run neo_search_index on all of your models.
|
43
|
-
search in multiple types at once with `Neoid.search(types_array, term)
|
44
|
-
|
45
|
-
## v0.0.3
|
46
|
-
|
47
|
-
* new configuration syntax (backwards compatible)
|
48
|
-
* full text search index
|
49
|
-
|
50
|
-
## v0.0.2
|
51
|
-
|
52
|
-
* create node immediately after active record create
|
53
|
-
* logging
|
54
|
-
* bug fixes
|
55
|
-
|
56
|
-
## v0.0.1
|
57
|
-
|
58
|
-
* initial release
|
data/Gemfile
DELETED
data/TODO.md
DELETED
data/neoid.gemspec
DELETED
@@ -1,28 +0,0 @@
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
2
|
-
$:.push File.expand_path("../lib", __FILE__)
|
3
|
-
require "neoid/version"
|
4
|
-
|
5
|
-
Gem::Specification.new do |s|
|
6
|
-
s.name = "neoid"
|
7
|
-
s.version = Neoid::VERSION
|
8
|
-
s.authors = ["Elad Ossadon"]
|
9
|
-
s.email = ["elad@ossadon.com"]
|
10
|
-
s.homepage = ""
|
11
|
-
s.summary = %q{Neo4j for ActiveRecord}
|
12
|
-
s.description = %q{Extend Ruby on Rails ActiveRecord with Neo4j nodes. Keep RDBMS and utilize the power of Neo4j queries}
|
13
|
-
|
14
|
-
s.rubyforge_project = "neoid"
|
15
|
-
|
16
|
-
s.files = `git ls-files`.split("\n")
|
17
|
-
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
18
|
-
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
19
|
-
s.require_paths = ["lib"]
|
20
|
-
|
21
|
-
s.add_development_dependency 'rake'
|
22
|
-
s.add_development_dependency 'rspec'
|
23
|
-
s.add_development_dependency 'rest-client'
|
24
|
-
s.add_development_dependency 'activerecord'
|
25
|
-
s.add_development_dependency 'sqlite3'
|
26
|
-
|
27
|
-
s.add_runtime_dependency 'neography'
|
28
|
-
end
|