meta-record 1.0.14 → 1.0.15
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/metarecord/generators/crails/destroy_generator.rb +4 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5d3e37fd89be58f819847b4eaa49b18206fd235b84a80029e1dfa44a057d4d22
|
4
|
+
data.tar.gz: 50078c7348e02d15f663b6db14e56e03708b8df1c915369ac1a307bf8ce774f4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9c4ef7b1b0c065d983e7677f549042c4883a5f6ea794acc83ce06cdce2f19d385ca56393e5eaf5966872f4295f7bbacb458d1983cc454898ae6d7f7911b5f962
|
7
|
+
data.tar.gz: 8510f243fb442bbdc1525eb0efe81cfb42fb68f5ea90a63aba5e391638fc20b80a2ab66d840b0d3c3b11475c35f3c991741f5af6e807fce5a1cb201e55edf31f
|
@@ -91,8 +91,8 @@ class CrailsDestroyGenerator < GeneratorBase
|
|
91
91
|
end
|
92
92
|
|
93
93
|
def one_to_many relation
|
94
|
-
_append "typedef odb::query
|
95
|
-
_append "odb::result
|
94
|
+
_append "typedef odb::query<#{relation[:class]}> Query;"
|
95
|
+
_append "odb::result<#{relation[:class]}> models;"
|
96
96
|
_append "Query query;\n"
|
97
97
|
|
98
98
|
if relation[:options][:joined] != false
|
@@ -100,8 +100,8 @@ class CrailsDestroyGenerator < GeneratorBase
|
|
100
100
|
else
|
101
101
|
_append "query = Query::#{relation[:field]}_id == self_id;"
|
102
102
|
end
|
103
|
-
_append "database.find
|
104
|
-
_append "for (auto model : Crails::Odb::to_vector
|
103
|
+
_append "database.find<#{relation[:class]}>(models, query);"
|
104
|
+
_append "for (auto model : Crails::Odb::to_vector<#{relation[:class]}>(models))"
|
105
105
|
if relation[:options][:dependent] == :destroy
|
106
106
|
_append " database.destroy(model);"
|
107
107
|
elsif relation[:options][:dependent] == :unlink
|