effective_developer 0.2.14 → 0.3.0

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: f1e8bc3236c0e1ce5bb52c08ac6105249c74a8fc
4
- data.tar.gz: 6da5bb23480dd1610d6d78d3688429432c3b3a58
3
+ metadata.gz: bf305c231784d1c6bce30322420dc57cf142f28a
4
+ data.tar.gz: d65e5ccd3796a73b487cffd2d6b76e28fa028371
5
5
  SHA512:
6
- metadata.gz: 28bdaff7f0e1f2d4c324bf3d9745b6e8be5edb54207797a8d9992d3e45cedc0de91d65364cdaf64c61a6b9c93dddb4a0b525cd2a1aac4421845bdc28a421b972
7
- data.tar.gz: 9864e792788e90bf6d32131f04f4aa782c9402884b67abc2688c4c11e9d1b9d205d01c9a236df5d8889395aff2272d2e9a38851897778b45f13528361c7884d5
6
+ metadata.gz: f429b820f1e2efac22656c02cb4efee990c2df168d8d8a65621eb9cb4bb294aa14c6170e3cc16266b8efa8032d9ddbb68dc59db79e41cc2a47408739fe1f5f65
7
+ data.tar.gz: 11bb3454c678fb367542478eaa4d946a22f5d3f29f8d80201b1d4a011ea20d3afe0c44a6debedd9c6042a5fd834ea454a9a37231b0f3d937d49607d26e93f893
@@ -1,3 +1,3 @@
1
1
  module EffectiveDeveloper
2
- VERSION = '0.2.14'.freeze
2
+ VERSION = '0.3.0'.freeze
3
3
  end
@@ -54,7 +54,14 @@ module Effective
54
54
  klass_attributes = resource.klass_attributes(all: all)
55
55
 
56
56
  if klass_attributes.blank?
57
- if ActiveRecord::Migrator.new(:up, ActiveRecord::Migrator.migrations(ActiveRecord::Migrator.migrations_paths)).pending_migrations.present?
57
+
58
+ if ActiveRecord::Migration.respond_to?(:check_pending!)
59
+ pending = (ActiveRecord::Migration.check_pending! rescue true)
60
+ else
61
+ pending = ActiveRecord::Migrator.new(:up, ActiveRecord::Migrator.migrations(ActiveRecord::Migrator.migrations_paths)).pending_migrations.present?
62
+ end
63
+
64
+ if pending
58
65
  migrate = ask("Unable to read the attributes of #{resource.klass || resource.name}. There are pending migrations. Run db:migrate now? [y/n]")
59
66
  system('bundle exec rake db:migrate') if migrate.to_s.include?('y')
60
67
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_developer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.14
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-07-10 00:00:00.000000000 Z
11
+ date: 2018-07-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails