active_storage_validations 0.5.1 → 0.5.2

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: 2501b8cdd1162e90088185dc89db71838ff63b9d
4
- data.tar.gz: 2e08cbebaad918109615e604fe78f8ab323b5488
3
+ metadata.gz: 2a4209dd92d74b7758784e591d56cdc10616dd88
4
+ data.tar.gz: cd79dca0cb3abd9d97d5431a96c5276e67b9fed5
5
5
  SHA512:
6
- metadata.gz: 42098a546430f2ddc6cdd4f06c51d91bbdde962c06108c4e0d6b8a1a80c69028caac6080dfa19283710c11b6b9f4bb29dcc379add02bec91e7c84995ea4d4ef4
7
- data.tar.gz: 4922ed55b2e7a9a7ae381e279c21f5c9c25085eda26139c2921cda45110211f970fe8305a934d84b5e4c32db94c5a9a7c407f1acc2327b0e9d0774c57f58e102
6
+ metadata.gz: fdfba49b03a92b90ac28214775c7fc25e9223f5176fa2a1dd68f150f1bd2d297f95721c328ce50afa474d5f638d21dacbe826c2fbe51e414436602d396e94abb
7
+ data.tar.gz: eb3b951a07f562fb8ec266b27405690ac404b314bb6aa2856b5f3d33e50ac8d9ded11419ce9c205cc04321d747349b15cccb0ae3a5225813ed84a7be03d203e0
data/README.md CHANGED
@@ -95,7 +95,7 @@ You are welcome to contribute.
95
95
  - https://github.com/tleneveu
96
96
  - https://github.com/reckerswartz
97
97
  - https://github.com/Uysim
98
-
98
+ - https://github.com/D-system
99
99
 
100
100
  ## License
101
101
  The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
@@ -4,7 +4,6 @@ require 'active_storage_validations/attached_validator'
4
4
  require 'active_storage_validations/content_type_validator'
5
5
  require 'active_storage_validations/size_validator'
6
6
 
7
-
8
-
9
-
10
- ActiveRecord::Base.send :include, ActiveStorageValidations
7
+ ActiveSupport.on_load(:active_record) do
8
+ self.send :include, ActiveStorageValidations
9
+ end
@@ -30,7 +30,7 @@ module ActiveStorageValidations
30
30
  end
31
31
 
32
32
  def content_type(file)
33
- file.blob.content_type
33
+ file.blob.present? && file.blob.content_type
34
34
  end
35
35
 
36
36
  def content_type_valid?(file)
@@ -1,3 +1,3 @@
1
1
  module ActiveStorageValidations
2
- VERSION = '0.5.1'
2
+ VERSION = '0.5.2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_storage_validations
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Igor Kasyanchuk
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-10-04 00:00:00.000000000 Z
11
+ date: 2018-11-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails