echo_uploads 0.0.22 → 0.0.23

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: ab518cb10d7eba1c95a48a067e4bb86d923e143b
4
- data.tar.gz: a180ec2f68fd32cf759c28975acc1c362106c294
3
+ metadata.gz: 804822a92afb63c74d6ee6dd5a87dc4b0d017bf8
4
+ data.tar.gz: 3ef8ca40d697d45725331a3cab0f646318d16051
5
5
  SHA512:
6
- metadata.gz: dd6a3b2988b4bd5599583c76d58c6a9540d77c514be8386b78d9a8d53bf7a92868ca1b984f001468ee0c1ac827c7feaf79290f4a77be3286494b46e3ecd8d56d
7
- data.tar.gz: 34460a5a568fc04096fdd77ebae11baf02e0837ae486f1fbc36a64d39bf23051222bce489de15be73d1e86ab09b79146899bc1355028b5a8d3dd5adc5163240b
6
+ metadata.gz: ed779c8251d35a4d4e56df9b4098af245e5127aefb060bb5af18f9550febf82c2de8f102053ac87338c24a042567ec2626d2f43dd665e82e7a9852fd21d5c3cd
7
+ data.tar.gz: bfe6cbebde5c81dd5d1ba28479569621605e2e841735d5cfce07c6a57e8548b8e61d76d1a4c38fab69405feb05418a5cbc1da88c5c70e19b54046c286a20fb31
@@ -120,10 +120,17 @@ module EchoUploads
120
120
  self.echo_uploads_config = echo_uploads_config.merge attr => {}
121
121
 
122
122
  # Define reader method for the file attribute.
123
- if Rails::VERSION::MAJOR >= 5
123
+ if Rails::VERSION::MAJOR >= 5 and Rails::VERSION::MINOR >= 1
124
124
  attribute attr
125
125
  else
126
126
  attr_reader attr
127
+ define_method("#{attr}=") do |file|
128
+ instance_variable_set "@#{attr}", file
129
+ if send(attr).present?
130
+ # Mark as dirty.
131
+ attribute_will_change! attr
132
+ end
133
+ end
127
134
  end
128
135
 
129
136
  # Define the accessor methods for the mapped version(s) of the file. Returns
@@ -1,3 +1,3 @@
1
1
  module EchoUploads
2
- VERSION = '0.0.22'
2
+ VERSION = '0.0.23'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: echo_uploads
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.22
4
+ version: 0.0.23
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jarrett Colby
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-05-03 00:00:00.000000000 Z
11
+ date: 2017-05-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: mime-types