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 +4 -4
- data/app/assets/javascripts/meta_model.js.coffee +1 -0
- data/app/assets/javascripts/templates/models/edit.emblem +6 -0
- data/app/controllers/neo4j/meta_model/meta/models_controller.rb +2 -1
- data/app/serializers/neo4j/meta_model/model_serializer.rb +1 -0
- data/lib/meta_models.rb +6 -1
- data/lib/neo4j/meta_model/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7cd616550c92c6ba0f55b9eb5fbd7b24aaa96a4d
|
4
|
+
data.tar.gz: 8d3765d790a020f9addde04700f837a33c41271a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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
|
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
|
-
|
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|
|
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.
|
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-
|
11
|
+
date: 2015-01-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|