architect4r 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- data/ReleaseNotes.md +7 -0
- data/lib/architect4r/model/queries.rb +4 -2
- data/lib/architect4r/version.rb +1 -1
- data/spec/model/queries_spec.rb +1 -0
- metadata +4 -4
data/ReleaseNotes.md
CHANGED
@@ -1,5 +1,12 @@
|
|
1
1
|
# Release Notes
|
2
2
|
|
3
|
+
## v0.4.2
|
4
|
+
|
5
|
+
* Unify the finder interface and use ```Node#find(id)``` in favor of ```Node#find_by_id(id)```
|
6
|
+
|
7
|
+
Now nodes and relationships are using the same interface. Moreover, architect4r should be
|
8
|
+
more compatible with other gems (search, …).
|
9
|
+
|
3
10
|
## v0.4.1
|
4
11
|
|
5
12
|
* Allow logging of cypher queries for easier debugging
|
@@ -16,15 +16,17 @@ module Architect4r
|
|
16
16
|
|
17
17
|
# Fetch a record of the specified model based on its id
|
18
18
|
#
|
19
|
-
def
|
19
|
+
def find(id)
|
20
20
|
data = connection.execute_cypher("start s=node(#{self.model_root.id}), d=node(#{id.to_i}) match s<-[r:model_type]-d return d")
|
21
21
|
data &&= data['data'] && data['data'].flatten.first
|
22
22
|
self.build_from_database(data)
|
23
23
|
end
|
24
|
+
alias :find_by_id :find
|
24
25
|
|
25
|
-
def
|
26
|
+
def find!(id)
|
26
27
|
self.find_by_id(id) || raise(Architect4r::RecordNotFound.new("Could not find the #{self.name} with id #{id}!"))
|
27
28
|
end
|
29
|
+
alias :find_by_id! :find!
|
28
30
|
|
29
31
|
# Use this method only to fetch items of the same class.
|
30
32
|
def find_by_cypher(query, identifier)
|
data/lib/architect4r/version.rb
CHANGED
data/spec/model/queries_spec.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: architect4r
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 11
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 4
|
9
|
-
-
|
10
|
-
version: 0.4.
|
9
|
+
- 2
|
10
|
+
version: 0.4.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Maximilian Schulz
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-01
|
18
|
+
date: 2012-02-01 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: activemodel
|