activerecord-turntable 2.3.2 → 2.3.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c476ca06fe32521466081db5b034dfe1130aafbb
4
- data.tar.gz: 9028b37ecd050d7b72a9899648646c1d4ad264a7
3
+ metadata.gz: fa472cf634328899013e975790cca934f62d5b34
4
+ data.tar.gz: 345bb3bc47f17141e12dfe9a0b2179d4e8db5f07
5
5
  SHA512:
6
- metadata.gz: dc66f30118970d7d9650d88a6cb41a554c80287a43c20dde5dcfa41cc2376b81e16e3d9d2cb3d6733b80d664d9abe602857c0a2c6ec042f35860938b220eb9be
7
- data.tar.gz: 243b4ed88d4c256ca3614941fcd5567023559afc6a5aaf8d8e9b67548dbe3ad85e28b33944eca3693eb605e80e2c085ad2c366e244dd523e9f0823e2276cb012
6
+ metadata.gz: 9996e3262e5887a1ec95e6355dac2f3d3aaaa5d10e580dbc1e7e6ffcdfedc8af75cd6cc7cbef9f0551961cc38d25123c883d42e4a6e10f0f0ee34a327d915b91
7
+ data.tar.gz: f47e0368705ac7b0073721544feef5838aca511c7c26464957e173700a8ef73ec9f3d0741706384bb792e271149a6e27355d4d1481ed8bf275c7d75f8fe383d1
data/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## activerecord-turntable 2.3.3 ##
2
+
3
+ ### Bugfix
4
+
5
+ * Fallback `sequence_name` to parent modules, because ar-import expects original `sequence_name` result(= nil)
6
+
1
7
  ## activerecord-turntable 2.3.2 ##
2
8
 
3
9
  ### Improvement
@@ -9,7 +9,11 @@ module ActiveRecord::Turntable::ActiveRecordExt
9
9
 
10
10
  module DatabaseStatements
11
11
  def default_sequence_name(table_name, pk = nil)
12
- ActiveRecord::Turntable::Sequencer.sequence_name(table_name, pk)
12
+ if ActiveRecord::Turntable::Sequencer.has_sequencer?(table_name)
13
+ ActiveRecord::Turntable::Sequencer.sequence_name(table_name, pk)
14
+ else
15
+ super
16
+ end
13
17
  end
14
18
  end
15
19
 
@@ -1,5 +1,5 @@
1
1
  module ActiveRecord
2
2
  module Turntable
3
- VERSION = "2.3.2"
3
+ VERSION = "2.3.3"
4
4
  end
5
5
  end
@@ -0,0 +1,22 @@
1
+ require 'spec_helper'
2
+
3
+ describe ActiveRecord::Turntable::ActiveRecordExt::Sequencer do
4
+ before(:all) do
5
+ reload_turntable!(File.join(File.dirname(__FILE__), "../../../config/turntable.yml"))
6
+ end
7
+
8
+ before(:each) do
9
+ establish_connection_to(:test)
10
+ truncate_shard
11
+ end
12
+
13
+ context "With sequencer enabled model" do
14
+ subject { User }
15
+ its(:sequence_name) { is_expected.to_not be_nil }
16
+ end
17
+
18
+ context "With sequencer disabled model" do
19
+ subject { Card }
20
+ its(:sequence_name) { is_expected.to be_nil }
21
+ end
22
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord-turntable
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.2
4
+ version: 2.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - gussan
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-03-01 00:00:00.000000000 Z
12
+ date: 2016-03-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord
@@ -412,6 +412,7 @@ files:
412
412
  - spec/active_record/turntable/active_record_ext/locking_optimistic_spec.rb
413
413
  - spec/active_record/turntable/active_record_ext/migration_spec.rb
414
414
  - spec/active_record/turntable/active_record_ext/persistence_spec.rb
415
+ - spec/active_record/turntable/active_record_ext/sequencer_spec.rb
415
416
  - spec/active_record/turntable/active_record_ext/test_fixtures_spec.rb
416
417
  - spec/active_record/turntable/algorithm/modulo_algorithm_spec.rb
417
418
  - spec/active_record/turntable/algorithm/range_algorithm_spec.rb
@@ -483,6 +484,7 @@ test_files:
483
484
  - spec/active_record/turntable/active_record_ext/locking_optimistic_spec.rb
484
485
  - spec/active_record/turntable/active_record_ext/migration_spec.rb
485
486
  - spec/active_record/turntable/active_record_ext/persistence_spec.rb
487
+ - spec/active_record/turntable/active_record_ext/sequencer_spec.rb
486
488
  - spec/active_record/turntable/active_record_ext/test_fixtures_spec.rb
487
489
  - spec/active_record/turntable/algorithm/modulo_algorithm_spec.rb
488
490
  - spec/active_record/turntable/algorithm/range_algorithm_spec.rb