enumbler 0.9.0 → 0.9.1

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
  SHA256:
3
- metadata.gz: af754378eb4d6913b7d2f6521ae88e1cc59ceb3b8d76211e1cad637bc154634f
4
- data.tar.gz: 19fcc7da7e52d35a079e9fbb4da6781d84df7b704fe1482a69ec553edf2dd709
3
+ metadata.gz: ab789606b3b4b29bf976ec57a54ca62c838209f286b440f32946f494c331b92e
4
+ data.tar.gz: 9bae37ac280295c70380949c7222e643a240f6c8aec3897c76ec4609349cdfa1
5
5
  SHA512:
6
- metadata.gz: db53c9304123815cbda6900f3855b33b6fe7100233bd8b0eb7dea3223fea32b57760fe0ea0adfe02b4f5cda86dea0bb8ce327873117369577045f7502ba4af07
7
- data.tar.gz: cdc6f3e944d5b1e92b2a6f41f118ef6d4685bb4bf78ce01c267f9549b9a009daf9b9d3edacd9111acfac96b4f1a2571181e29207684f9e197fd4f12d9afc8e76
6
+ metadata.gz: 06d0fa3bfbac702c77a2968e90a53b86a3912c3fa8f18bab1619d3d6c008e5e3c8daeab3f0e0edf5005f83ca02f06d17e58125728b22c26a3e4a3a97c929c793
7
+ data.tar.gz: 3cad767146fc58f6a103480ab57b749ff5522e80e3a397a71f374423c6a64104cd54f81b9e2107fb66f196dd5b3d445bcbf7204a05aa196a7a5b00c0b06d1746
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- enumbler (0.9.0)
4
+ enumbler (0.9.1)
5
5
  activerecord (>= 5.2.3, < 7)
6
6
  activesupport (>= 5.2.3, < 7)
7
7
 
@@ -401,7 +401,7 @@ module Enumbler
401
401
  end
402
402
 
403
403
  define_singleton_method(any_method_name) do
404
- where(id: enumble.id).exists?
404
+ exists?(id: enumble.id)
405
405
  rescue NoMethodError
406
406
  raise Enumbler::Error, "The attribute #{attr} is not supported on this Enumble."
407
407
  end
@@ -452,8 +452,14 @@ module Enumbler
452
452
 
453
453
  return if unsupported_attrs.blank?
454
454
 
455
+ ActiveRecord::Migration.check_pending!
456
+
455
457
  raise Enumbler::Error,
456
458
  "The model #{self} does not support the attribute(s): #{unsupported_attrs.keys.map(&:to_s).to_sentence}"
459
+ rescue ActiveRecord::PendingMigrationError
460
+ warn "[Enumbler Warning] => The model #{self} does not currently support the attribute(s): #{unsupported_attrs.keys.map(&:to_s).to_sentence}." \
461
+ " You have a pending migration which hopefully would remedy this! If not, you need to add a migration for this attibrute or" \
462
+ " remove it from the Enumbler."
457
463
  rescue ActiveRecord::StatementInvalid
458
464
  warn "[Enumbler Warning] => Unable to find a table for #{self}."\
459
465
  "This is to be expected if there is a pending migration; however, if there is not then something is amiss."
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Enumbler
4
- VERSION = "0.9.0"
4
+ VERSION = "0.9.1"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: enumbler
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.9.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Damon Timm
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-01-12 00:00:00.000000000 Z
11
+ date: 2021-04-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -199,7 +199,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
199
199
  - !ruby/object:Gem::Version
200
200
  version: '0'
201
201
  requirements: []
202
- rubygems_version: 3.1.4
202
+ rubygems_version: 3.1.6
203
203
  signing_key:
204
204
  specification_version: 4
205
205
  summary: Enums are terrific, but lack integrity. Let's add some!