meta-record 1.0.1 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 20cb8eea318a55b539b48eca34a554755cb624a6944180cd7dc611591f4db39d
4
- data.tar.gz: 36933fe0fde7d856c30b6c6a50b1c0d1aa8bf2fa660989a54844398eeac3606f
3
+ metadata.gz: 786c4b11d58a3d7f2deb98548948c2cd0d633e7b9668009238618f64676253b7
4
+ data.tar.gz: 58a44c730e52b5a8ab8b6e7b27ccbecb5d281c212d9adfdfcd4ab3c897712648
5
5
  SHA512:
6
- metadata.gz: e43594ecafa0f39f5a11f8450ec9c2a2fd5dddf2a3ffd9208dec9cd62402d3c436acdc9b260d1bd668da6a7a7a170f139bb5f76032d611fc56ffc894dbf83b57
7
- data.tar.gz: 1668284a722f57efcecfc0ea220c3103e1dd1b52358881f96823347444165c7828755b0a175b6b31425db8be6ade028afc3ea55616f8d607abd0b3b1fd34c63d
6
+ metadata.gz: 9fe116030201ba224440f225d60ffebf3c7b948433345dc67745d0d4879a55859d8e4fe4cbde9a6ea1a02e92415356f5218f6d08bdc1a7ba5d2ba3d67d6f6d5e
7
+ data.tar.gz: f3eb527ebc8ba619f8e0bdf66237419496b0972c5fa028f9d78800d1635d888c4c56ab0bd64c9025917517484686a076ba841eb34e44c16e79cabfde165a7250
@@ -176,7 +176,7 @@ class GeneratorBase
176
176
  if defined? METARECORD_ID_TYPE
177
177
  METARECORD_ID_TYPE
178
178
  else
179
- "ODB::id_type"
179
+ "Crails::Odb::id_type"
180
180
  end
181
181
  end
182
182
 
@@ -150,7 +150,7 @@ class CrailsDestroyGenerator < GeneratorBase
150
150
  _append "odb::result<#{relation[:class]}> models;"
151
151
  _append "Query query;\n"
152
152
  id_field = "#{get_singular_name relation[:field]}_ids"
153
- _append "query = Query::#{id_field} + \"@>\" + ODB::array_to_string(ids, \"int\");"
153
+ _append "query = Query::#{id_field} + \"@>\" + Crails::Odb::array_to_string(ids, \"int\");"
154
154
  _append "database.find<#{relation[:class]}>(models, query);"
155
155
  _append "for (auto model : odb::to_vector<#{relation[:class]}>(models))"
156
156
  _append "{"
@@ -330,7 +330,7 @@ class CrailsEditGenerator < GeneratorBase
330
330
  _append "odb::result<#{type}> results;"
331
331
  _append "#{name}.clear();"
332
332
  _append "database.find<#{type}>(results,"
333
- _append " query::id + \"=\" + ODB::any(#{singular_name}_ids, \"int\")"
333
+ _append " query::id + \"=\" + Crails::Odb::any(#{singular_name}_ids, \"int\")"
334
334
  _append ");"
335
335
  _append "for (auto model : results)"
336
336
  _append " #{name}.push_back(std::make_shared<#{type}>(model));"
@@ -58,7 +58,7 @@ CPP
58
58
  if (#{name} == nullptr)
59
59
  errors["#{name}_id"]["t"] = "validate.required";
60
60
  CPP
61
- elsif type == "ODB::id_type"
61
+ elsif type == "Crails::Odb::id_type"
62
62
  <<CPP
63
63
  if (#{name} == 0)
64
64
  errors["#{name}"]["t"] = "validate.required";
@@ -1,23 +1,23 @@
1
1
  module RailsTypeHelpers
2
2
  def get_record_type type
3
3
  case type
4
- when "ODB::id_type" then :bigint
5
- when "char" then :tinyint
6
- when "unsigned char" then :smallint
7
- when "short" then :smallint
8
- when "unsigned short" then :mediumint
9
- when "int" then :integer
10
- when "unsigned int" then :integer
11
- when "long" then :bigint
12
- when "long long" then :bigint
13
- when "unsigned long" then :bigint
14
- when "unsigned long long" then :bigint
15
- when "double" then :float
16
- when "long double" then :float
17
- when "float" then :float
18
- when "bool" then :boolean
19
- when "std::string" then :string
20
- when "std::time_t" then :timestamp
4
+ when "Crails::Odb::id_type" then :bigint
5
+ when "char" then :tinyint
6
+ when "unsigned char" then :smallint
7
+ when "short" then :smallint
8
+ when "unsigned short" then :mediumint
9
+ when "int" then :integer
10
+ when "unsigned int" then :integer
11
+ when "long" then :bigint
12
+ when "long long" then :bigint
13
+ when "unsigned long" then :bigint
14
+ when "unsigned long long" then :bigint
15
+ when "double" then :float
16
+ when "long double" then :float
17
+ when "float" then :float
18
+ when "bool" then :boolean
19
+ when "std::string" then :string
20
+ when "std::time_t" then :timestamp
21
21
  else nil
22
22
  end
23
23
  end
@@ -28,7 +28,7 @@ class ManifestGenerator < GeneratorBase
28
28
  db_options = options[:db] || Hash.new
29
29
  column_name = db_options[:column] || "#{name}_id"
30
30
  db_options.delete :column
31
- @current_manifest_item[column_name] = { type: "ODB::id_type", options: db_options }
31
+ @current_manifest_item[column_name] = { type: "Crails::Odb::id_type", options: db_options }
32
32
  end
33
33
 
34
34
  def has_many type, name, options = {}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: meta-record
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Martin Moro