neo4j-meta_model 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 50d18168819549a01ce435b29697380f15acbbe0
4
- data.tar.gz: 90ecf10a0ecf5e108e740a4c510af149d29157bf
3
+ metadata.gz: 3af4c93ad4a175e6237828a4a954a1614ce27e83
4
+ data.tar.gz: 91e49d85ba7e756bf6edaeadcfa35ac1c8147ff7
5
5
  SHA512:
6
- metadata.gz: a98399eb241b2119c35dabfdbf1db2bed36125aadab6f250bd3281635eb767fdd3f67e1fe8607c761d4d8086d6258c5da56eacc1a55208e6ef08603426d155b1
7
- data.tar.gz: 87482727f8cdf54cff1bd3ff1d077c5032005010fa2067d3ffc23a4d7a1d0131657e04dc42bd86fc9c959559ff95268b92f02b4ce103483b180f8524cf88d83e
6
+ metadata.gz: 4609287d44579471b0c04d18961d072b95a4342659f088c869398846e6c58751eca9a4fdcc703b24720b86c0518e90b33fcbc23eadd32e5c06d97597ca28acc8
7
+ data.tar.gz: ef14ead112aeaa816f18132251301bdd9005cc1874f00dda7a16be2da768ef959688d28428571406926596b3f529f4476733baec61170a3cdb648e4ad3791507
@@ -19,7 +19,9 @@ module Neo4j
19
19
 
20
20
  def naming_column
21
21
  # Probably want to allow the user to choose this
22
- Neo4j::MetaModel::Model.where(class_name: meta_model_class).first.properties.detect {|p| p.type == 'String' }.name
22
+ column = (['name', 'title', 'description'] & attributes.keys).first
23
+
24
+ column || Neo4j::MetaModel::Model.where(class_name: meta_model_class).first.properties.detect {|p| p.type == 'String' }.name
23
25
  end
24
26
  end
25
27
 
@@ -38,7 +40,7 @@ module Neo4j
38
40
  end
39
41
 
40
42
  def _description
41
- self.try(:name) || self.try(:title) || self.try(:description) || self.id
43
+ self.send(self.class.naming_column)
42
44
  end
43
45
  end
44
46
  end
@@ -1,5 +1,5 @@
1
1
  module Neo4j
2
2
  module MetaModel
3
- VERSION = "0.3.1"
3
+ VERSION = "0.3.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: neo4j-meta_model
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Underwood
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-06 00:00:00.000000000 Z
11
+ date: 2015-02-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails