draft_punk 0.2.6 → 0.2.7

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: 2e1f37ab686d6608e3d210de16e50f8874877b86
4
- data.tar.gz: 9d49ee3b5844090e4f5e602be9777dd6ac41f453
3
+ metadata.gz: 1d4a6420f3e781377149fe2a5501e9f98a0919a7
4
+ data.tar.gz: 3bff87d484861606d197f4ffd20b531bb3b474f3
5
5
  SHA512:
6
- metadata.gz: 689cd3a9c566de8cbf8ab8970f976767ccde62e8de369384739826ab847ddc3dc2b7260351c364081c5b11037a44eeaf51adb25899d69ff29cbee6b22e7b11e3
7
- data.tar.gz: 42a85f21e29a67b9917b10fb4993967cf3a6028dcd00aa816a9be2035e8c9610c7e08c3b0551f3cd2c092470904a9d15e2077c3feb688a5a2160c76c42cbe349
6
+ metadata.gz: 008e3ddeb9db92ef6c7ec4ddfddf457ca854831d294b100b42f921aa495bc67a62e0e9371e73f2af012ff562a92dd314682788bd9e1d0fa7dbf6deebb4e6c3da
7
+ data.tar.gz: fbb7819e33a842c8802408bd766e83fda9a22e2b941abc037cf276406772fac686b9658ff506d3e8f53dd013d407c9c27e8fee118a96e93775e7345b659636f7
@@ -34,7 +34,7 @@ EOF
34
34
  spec.add_runtime_dependency "amoeba", "~> 3.0"
35
35
  spec.add_runtime_dependency "unscoped_associations", "< 1.0"
36
36
  spec.add_runtime_dependency "differ", "< 0.2"
37
- spec.add_runtime_dependency 'rails', "> 3.0", "< 5.0"
37
+ spec.add_runtime_dependency 'rails', "> 3.0", "< 5.1"
38
38
 
39
39
  spec.add_development_dependency "bundler", "~> 1.9"
40
40
  spec.add_development_dependency "rake", "~> 10.0"
@@ -45,7 +45,7 @@ module DraftPunk
45
45
  # @param associations [Array] Use internally; set associations to create drafts for in the CREATES_NESTED_DRAFTS_FOR constant
46
46
  # @return true
47
47
  def requires_approval(associations: [], nullify: [], set_default_scope: false)
48
- return unless ActiveRecord::Base.connection.table_exists?(table_name) # Short circuits if you're migrating
48
+ return unless draft_punk_table_exists?(table_name) # Short circuits if you're migrating
49
49
 
50
50
  associations = draft_target_associations if associations.empty?
51
51
  set_valid_associations(associations)
@@ -109,7 +109,7 @@ module DraftPunk
109
109
  reflection = reflect_on_association(assoc)
110
110
  if reflection
111
111
  table_name = reflection.klass.table_name
112
- ActiveRecord::Base.connection.table_exists?(table_name)
112
+ draft_punk_table_exists?(table_name)
113
113
  else
114
114
  false
115
115
  end
@@ -181,6 +181,13 @@ module DraftPunk
181
181
  activerecord_reflection.macro.in? Amoeba::Config::DEFAULTS[:known_macros]
182
182
  end
183
183
 
184
+ def draft_punk_table_exists?(table_name)
185
+ if ActiveRecord::Base.connection.respond_to? :data_source_exists?
186
+ ActiveRecord::Base.connection.data_source_exists?(table_name)
187
+ else
188
+ ActiveRecord::Base.connection.table_exists?(table_name)
189
+ end
190
+ end
184
191
  end
185
192
 
186
193
  end
@@ -1,3 +1,3 @@
1
1
  module DraftPunk
2
- VERSION = "0.2.6"
2
+ VERSION = "0.2.7"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: draft_punk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.6
4
+ version: 0.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steve Hodges
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-12-09 00:00:00.000000000 Z
11
+ date: 2017-03-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: amoeba
@@ -61,7 +61,7 @@ dependencies:
61
61
  version: '3.0'
62
62
  - - "<"
63
63
  - !ruby/object:Gem::Version
64
- version: '5.0'
64
+ version: '5.1'
65
65
  type: :runtime
66
66
  prerelease: false
67
67
  version_requirements: !ruby/object:Gem::Requirement
@@ -71,7 +71,7 @@ dependencies:
71
71
  version: '3.0'
72
72
  - - "<"
73
73
  - !ruby/object:Gem::Version
74
- version: '5.0'
74
+ version: '5.1'
75
75
  - !ruby/object:Gem::Dependency
76
76
  name: bundler
77
77
  requirement: !ruby/object:Gem::Requirement
@@ -202,3 +202,4 @@ specification_version: 4
202
202
  summary: Easy editing of a draft version of an ActiveRecord model and its associations,
203
203
  and publishing said draft's changes back to the original models.
204
204
  test_files: []
205
+ has_rdoc: yard