neo4j-meta_model 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c59ca24b3c081e656c5d85812d02153cf575646f
4
- data.tar.gz: e7c7ad13049ee78db337c556ea2f098070c5b354
3
+ metadata.gz: 7cd616550c92c6ba0f55b9eb5fbd7b24aaa96a4d
4
+ data.tar.gz: 8d3765d790a020f9addde04700f837a33c41271a
5
5
  SHA512:
6
- metadata.gz: 4aea7dd9aa156190dee6d8f9631efe1f5a50d0e283df4f0f7cddd6fb96073da05d4cf583d5c802e029f8f29086ebc6cb3c575d6a16c13bc28f15fc6c45194d6d
7
- data.tar.gz: 5cba1126627033b0d1a18956729285252f1006957ea268c311b33e6b7605a0e2e14f1840764205395f3104f935362e25cd350bb555f3560a4899d5d795a0b714
6
+ metadata.gz: 8393ca2feb0c1045ee087dd8e4030280cfa352c3bb59e6f661f23dd01776f7551388a9c0c8bbc865692d72e827bd6f54e6527ea164066b866381e24ac9a8e9ce
7
+ data.tar.gz: 76df00092a64b888f09064d74b13b7e78a6e8053048ba3a5f1bfc83fc9c61221181cef770ed439eaf15bd9cc53630dc37d2cf4403f416eecb3840dd95c9806f2
@@ -103,6 +103,7 @@ ready = ->
103
103
  superclass_model: DS.belongsTo 'Model'
104
104
  #superclass_model: DS.attr 'string'
105
105
  properties: DS.hasMany 'Property'
106
+ id_property: DS.belongsTo 'Property'
106
107
  source_has_associations: DS.hasMany 'HasAssociation', inverse: 'to_model'
107
108
  destination_has_associations: DS.hasMany 'HasAssociation', inverse: 'from_model'
108
109
 
@@ -16,6 +16,12 @@
16
16
  | Properties
17
17
  a.add.btn.btn-default click="add_property model.model" Add Property
18
18
 
19
+ .form-group
20
+ label
21
+ .col-sm-2.control-label ID Property
22
+ .col-sm-10
23
+ view "select" content=model.model.properties selectionBinding="model.model.id_property" optionValuePath="content.id" optionLabelPath="content.name" prompt="Please Select" class="form-control"
24
+
19
25
  each property in model.model.properties
20
26
  .well.property.col-sm-6 class=property.isDirty:has-warning:
21
27
  i.glyphicon.glyphicon-remove-circle.close.pull-right click="delete_property property"
@@ -73,7 +73,8 @@ module Neo4j
73
73
 
74
74
  def model_params
75
75
  superclass_model = params[:model].delete(:superclass_model_id)
76
- params.require(:model).permit(:class_name, :superclass_model).merge(superclass_model: superclass_model)
76
+ id_property = params[:model].delete(:id_property_id)
77
+ params.require(:model).permit(:class_name, :superclass_model).merge(superclass_model: superclass_model, id_property: id_property)
77
78
  end
78
79
  end
79
80
  end
@@ -7,6 +7,7 @@ module Neo4j
7
7
 
8
8
  has_many :properties
9
9
  has_many :has_associations
10
+ has_one :id_property, serializer: PropertySerializer, root: 'properties'
10
11
  # has_one :superclass_model
11
12
  end
12
13
  end
data/lib/meta_models.rb CHANGED
@@ -25,8 +25,13 @@ def create_models
25
25
 
26
26
  code << " self.mapped_label_name = '#{model.class_name}'\n"
27
27
 
28
+
28
29
  model.properties.each do |property|
29
- code << " property :#{property.name}, type: #{property.type}\n"
30
+ if model.id_property == property
31
+ code << " id_property :#{property.name}\n"
32
+ else
33
+ code << " property :#{property.name}, type: #{property.type}\n"
34
+ end
30
35
  end
31
36
 
32
37
  model.assocs.each_with_rel do |other_model, rel|
@@ -1,5 +1,5 @@
1
1
  module Neo4j
2
2
  module MetaModel
3
- VERSION = "0.1.2"
3
+ VERSION = "0.2.0"
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.1.2
4
+ version: 0.2.0
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-01-26 00:00:00.000000000 Z
11
+ date: 2015-01-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails