nobrainer 0.33.0 → 0.34.0

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
  SHA1:
3
- metadata.gz: df0adf36ad09c91dff1d954dd2f82ed93a26be28
4
- data.tar.gz: 8c7f6c102a9be2b93a8086ac1d2969e3800ac2c3
3
+ metadata.gz: 6aeddbfcb32d5cd100bb92a6c05b6c6f5c45a15e
4
+ data.tar.gz: a6e70c12de29fe7154b19254220d52b7ad803e26
5
5
  SHA512:
6
- metadata.gz: 9fac2dbf39646bf1cee3a0921101a41453cdf82577733347d327026e0c05306faaf10622d281de9f0cb4c41d5f94f3b527135e7136ef8edd0cc6bfd25d5ac884
7
- data.tar.gz: 825bfeb592461326469dd3fdef0f74ac0d0877297dbbf0cdd291f6b0721144de9df10661dad60427be7be693606234af843f4bdab99f6d361669562344c7d998
6
+ metadata.gz: 997850d56ff98737d2f1c0feb498fe2c4377ee90e33eee54aeb9d574fd11c289faae0e348906b0df1d11d9f03088c5fb51a7fce4a762811b8e8323acca1ddd0c
7
+ data.tar.gz: acb35bf857b08452f31618bd80b304d69f195dd94a3b42d066ce6e9957d87e5ceffd7988a272de406156a0c343c9a85ee99e094182b1705f38560b2efae71392
@@ -12,7 +12,7 @@ module NoBrainer::Config
12
12
  :warn_on_active_record => { :default => ->{ true }, :valid_values => [true, false] },
13
13
  :durability => { :default => ->{ nil } }, # legacy
14
14
  :table_options => { :default => ->{ {:shards => 1, :replicas => 1, :write_acks => :majority} },
15
- :valid_keys => [:shards, :replicas, :primary_replica_tag, :write_acks, :durability] },
15
+ :valid_keys => [:durability, :shards, :replicas, :primary_replica_tag, :nonvoting_replica_tags, :write_acks] },
16
16
  :run_options => { :default => ->{ {:durability => default_durability} } },
17
17
  :max_string_length => { :default => ->{ 255 } },
18
18
  :user_timezone => { :default => ->{ :local }, :valid_values => [:unchanged, :utc, :local] },
@@ -107,7 +107,10 @@ module NoBrainer::Config
107
107
  end
108
108
 
109
109
  def default_app_name
110
- defined?(Rails) ? Rails.application.class.parent_name.underscore.presence : nil rescue nil
110
+ return unless defined?(Rails)
111
+ NoBrainer.rails6? ?
112
+ Rails.application.class.module_parent_name.underscore.presence :
113
+ Rails.application.class.parent_name.underscore.presence rescue nil
111
114
  end
112
115
 
113
116
  def default_environment
@@ -51,7 +51,8 @@ module NoBrainer::Document::Association::Core
51
51
  return model_name if model_name.is_a?(Module)
52
52
 
53
53
  model_name = model_name.to_s
54
- current_module = @owner_model.parent
54
+ current_module = NoBrainer.rails6? ? @owner_model.module_parent : @owner_model.parent
55
+
55
56
  return model_name.constantize if current_module == Object
56
57
  return model_name.constantize if model_name =~ /^::/
57
58
  return model_name.constantize if !current_module.const_defined?(model_name)
@@ -6,7 +6,7 @@ module NoBrainer::Document::TableConfig
6
6
 
7
7
  autoload :Synchronizer
8
8
 
9
- VALID_TABLE_CONFIG_OPTIONS = [:name, :durability, :shards, :replicas, :primary_replica_tag, :write_acks]
9
+ VALID_TABLE_CONFIG_OPTIONS = [:name, :durability, :shards, :replicas, :primary_replica_tag, :nonvoting_replica_tags, :write_acks]
10
10
 
11
11
  included do
12
12
  cattr_accessor :table_config_options, :instance_accessor => false
@@ -78,7 +78,7 @@ module NoBrainer::Document::TableConfig
78
78
  def sync_table_config(options={})
79
79
  c = table_create_options
80
80
  table_config.update!(c.slice(:durability, :primary_key, :write_acks))
81
- NoBrainer.run { rql_table.reconfigure(c.slice(:shards, :replicas, :primary_replica_tag)) }
81
+ NoBrainer.run { rql_table.reconfigure(c.slice(:shards, :replicas, :primary_replica_tag, :nonvoting_replica_tags)) }
82
82
  true
83
83
  end
84
84
 
@@ -7,4 +7,5 @@ class NoBrainer::System::TableConfig
7
7
  field :primary_key
8
8
  field :shards
9
9
  field :write_acks
10
+ field :indexes
10
11
  end
@@ -41,6 +41,10 @@ module NoBrainer
41
41
  Gem.loaded_specs['activesupport'].version >= Gem::Version.new('5.0.0.beta')
42
42
  end
43
43
 
44
+ def rails6?
45
+ Gem.loaded_specs['activesupport'].version >= Gem::Version.new('6.0.0')
46
+ end
47
+
44
48
  def eager_load!
45
49
  # XXX This forces all the NoBrainer code to be loaded in memory.
46
50
  # Not to be confused with eager_load() that operates on documents.
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nobrainer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.33.0
4
+ version: 0.34.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nicolas Viennot
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-09-27 00:00:00.000000000 Z
11
+ date: 2019-10-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rethinkdb
@@ -237,9 +237,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
237
237
  version: '0'
238
238
  requirements: []
239
239
  rubyforge_project:
240
- rubygems_version: 2.5.1
240
+ rubygems_version: 2.5.2.3
241
241
  signing_key:
242
242
  specification_version: 4
243
243
  summary: ORM for RethinkDB
244
244
  test_files: []
245
- has_rdoc: false