file_blobs_rails 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/file_blobs_rails.gemspec +2 -2
- data/lib/file_blobs_rails/blob_model.rb +3 -2
- data/test/active_record_extensions_test.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 15fdd0105ee566c33758f396b859af4f546d5e0b
|
4
|
+
data.tar.gz: 3597044746807e70a8fcb268718af81d31bbed99
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ecbbd76abb5f324a86e896d21f0e4d855f95a936cdb8c5c0bde6515c9da03bd0b34f03d4de0c009949d48a95a38167dba445612f99a6f20dcf5e92e968eac63d
|
7
|
+
data.tar.gz: aa4dd6d632b13e560b4301036ae87eb7ebcf75cfdcd12941671ed9f50df6e4bcb325b9eda823f8d13a5e96e336aa5f45487c8aa47abba782ecb7f263c7a5ed4c
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.3
|
data/file_blobs_rails.gemspec
CHANGED
@@ -2,11 +2,11 @@
|
|
2
2
|
# DO NOT EDIT THIS FILE DIRECTLY
|
3
3
|
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
4
|
# -*- encoding: utf-8 -*-
|
5
|
-
# stub: file_blobs_rails 0.2.
|
5
|
+
# stub: file_blobs_rails 0.2.3 ruby lib
|
6
6
|
|
7
7
|
Gem::Specification.new do |s|
|
8
8
|
s.name = "file_blobs_rails"
|
9
|
-
s.version = "0.2.
|
9
|
+
s.version = "0.2.3"
|
10
10
|
|
11
11
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
12
12
|
s.require_paths = ["lib"]
|
@@ -19,8 +19,9 @@ module BlobModel
|
|
19
19
|
# The raw data in the file.
|
20
20
|
validates :data, presence: true
|
21
21
|
validates_each :data do |record, attr, value|
|
22
|
-
|
23
|
-
|
22
|
+
data_limit = record.class.column_for_attribute(:data).limit
|
23
|
+
if data_limit && value && value.bytesize > data_limit
|
24
|
+
record.errors.add attr, 'is too large'.freeze
|
24
25
|
end
|
25
26
|
end
|
26
27
|
end
|
@@ -6,7 +6,7 @@ class ActiveRecordExtensionsTest < ActiveSupport::TestCase
|
|
6
6
|
end
|
7
7
|
|
8
8
|
test 'referenced blob validation' do
|
9
|
-
@blob_owner.
|
9
|
+
@blob_owner.file_blob.id = nil
|
10
10
|
assert !@blob_owner.valid?
|
11
11
|
assert_not_empty @blob_owner.errors[:file_blob]
|
12
12
|
end
|