bullet_train-roles 0.1.2 → 0.1.3

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: 0d21c45daee0837ca728e09e7f58b06c1f4ea4cafafb1b8bcb2879cd0cda90d1
4
- data.tar.gz: 7cbccf773dbcc32e408d7d4d8cbc386b1c4c8d03a582518d74ec0c145e3df517
3
+ metadata.gz: f41c9b86402531e17f5853d967530968368985d44a5130f011c8d6d0844691a7
4
+ data.tar.gz: 102b0571926e9a698b2654b8d54128b226e8c67ffdd10f626a18baf23b35c754
5
5
  SHA512:
6
- metadata.gz: 7b6f9b8bc5814c0e2e09001fe76943e7bb6bc0eea3e7925b357df0242a9b0bb5e50e97b96b7c13345779c65a363c07600ece86f04c78e238b3b3d6bf803e97b3
7
- data.tar.gz: 29a0ce6c63035adc7e75a4bde662ebf4b7242ad462eb89781e41fc546249a3abb31842ed0441b716c3c8a62d85119077d6e825eedf214300f646c02354667565
6
+ metadata.gz: 92706fc57f271f24cdcc2a6c204bbfeb21fe79e0a0b2cedd480c8ea51c62157e93f4665fe7de98f0ad0ff8b96fc04cd6448d408415faced1936e4d68a0521583
7
+ data.tar.gz: 50c64184545ecfcdab68be3163148ae0d1ee3727f23fb415cfa741418d66b1aed71946f4e3902413d118bd22abe2e6715840d2548835f72d3d4f019412297807
data/README.md CHANGED
@@ -54,7 +54,7 @@ The installer will:
54
54
 
55
55
  ### Limitations
56
56
 
57
- The generators currently assume you're using PostgreSQL and `jsonb` will be available when generating a `role_ids` column. If you're using MySQL, you can edit these migrations and use `json` instead, although you won't be able to set a default value and you'll need to take care of this in the model.
57
+ The generators currently assume you're using PostgreSQL and `jsonb` will be available when generating a `role_ids` column. If you're using MySQL, the generator will use `json` instead, although you won't be able to set a default value and you'll need to take care of this in the model.
58
58
 
59
59
  ## Usage
60
60
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Roles
4
- VERSION = "0.1.2"
4
+ VERSION = "0.1.3"
5
5
  end
@@ -58,6 +58,11 @@ module BulletTrain
58
58
  adapter_name
59
59
  end
60
60
 
61
+ def db_adapter_supports_defaults?
62
+ supported_db_adapters = %w[postgresql]
63
+ supported_db_adapters.include?(db_adapter)
64
+ end
65
+
61
66
  def find_json_data_type_identifier
62
67
  adapter_name = db_adapter
63
68
 
@@ -119,7 +124,7 @@ module BulletTrain
119
124
 
120
125
  generate "migration", "#{migration_file_name} role_ids:#{json_data_type_identifier}"
121
126
 
122
- add_default_value_to_migration(migration_file_name, top_level_model_table_name)
127
+ add_default_value_to_migration(migration_file_name, top_level_model_table_name) if db_adapter_supports_defaults?
123
128
 
124
129
  puts("Success 🎉🎉\n\n")
125
130
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bullet_train-roles
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Prabin Poudel