fdarchivo 0.1.0 → 0.2.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: 9707ba4a6f086453ad8b07e3c0a58bd46a05aac1aeee34aa1253fcec30166687
4
- data.tar.gz: 292b3fd134b818e3ed29b99792dfb2aaadfbe5c877c40bb2de1b6b00e659c89f
3
+ metadata.gz: 9da3195db8c90d43fc809b61e51987df9e0a4ff530fc246abc8a2a80f0b45f8e
4
+ data.tar.gz: 82b6d653b8050c00fda5e08666e1928d792ea181bdd71632e11097aa4800665a
5
5
  SHA512:
6
- metadata.gz: e46417b6400cf4cf6071170c779850ed341c5109f7c02b5fe32658cf4e7ab6b6002c0a8fbdee192925d2caeacae6ed59aa987c3914e739e167461808c0d92c53
7
- data.tar.gz: 5f98abf7fcc38e969160be1c94b72055ce4e4da48828f006d02f79fbfdb44beb98c23b873880f05aca9765efa9ae479b300c1b11460e5a07b6e56bf7adb8bef1
6
+ metadata.gz: 0673aa2e3b9e76bca5c8686f7bae08da1dfcea651df830f4c6287931847fb4c904193b910c58410364e15a2ff350c7445ba6871065aa2ad33e069cd686e80261
7
+ data.tar.gz: 8f4dd9970967e1ec74d42db0af2ca9b68acaf245aa7009d5c3a63ec1e914d849b256f439dfda45fa79caf2c225a8056822bbc9987b45ff109176ff0e9ab14b4f
@@ -7,7 +7,8 @@ class Archivo
7
7
  :DOC, # Documento
8
8
  :ARC # Archivo
9
9
  ]
10
-
10
+
11
+ field :name, type: String
11
12
  field :path, type: String
12
13
  field :public_url, type: String
13
14
  field :extension, type: String
@@ -30,17 +31,19 @@ class Archivo
30
31
  logo: true
31
32
  ).destroy_all
32
33
  end
33
- doc.extension = doc.path.split('.').last
34
- doc.tipo = check_tipo(doc.extension)
35
- if doc.tmp && doc.owner.blank?
36
- doc.path = "#{doc._id.to_s}.#{doc.extension}"
37
- else
38
- doc.path = "#{doc.owner.class.to_s.underscore}/#{doc.owner._id.to_s}/#{doc._id.to_s}.#{doc.extension}"
34
+ doc.extension = doc.path.split('.').last unless doc.extension
35
+ doc.tipo = check_tipo(doc.extension) unless doc.tipo
36
+ unless doc.path
37
+ if doc.tmp && doc.owner.blank?
38
+ doc.path = "#{doc._id.to_s}.#{doc.extension}"
39
+ else
40
+ doc.path = "#{doc.owner&.class&.to_s&.underscore}/#{doc.owner&._id.to_s}/#{doc&._id.to_s}.#{doc&.extension}"
41
+ end
39
42
  end
40
43
  end
41
44
 
42
45
  before_destroy do |doc|
43
- Fdarchivo.new(doc._id.to_s).archivo.try(:delete)
46
+ Fdarchivo.new(doc&._id&.to_s)&.archivo.try(:delete)
44
47
  end
45
48
 
46
49
 
@@ -54,7 +57,6 @@ class Archivo
54
57
  end
55
58
  end
56
59
  def self.reclamar(code, old_owner, owner)
57
- ap self.where(tmp: true, upload_code: code, owner: old_owner)
58
60
  self.where(tmp: true, upload_code: code, owner: old_owner).collect do |doc|
59
61
  doc.reclamar(owner: owner)
60
62
  end
@@ -1,3 +1,3 @@
1
1
  class Fdarchivo
2
- VERSION = '0.1.0'
2
+ VERSION = '0.2.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fdarchivo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
- - AdrianFP
7
+ - afuenteposadilla
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-06-09 00:00:00.000000000 Z
11
+ date: 2022-09-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -28,16 +28,16 @@ dependencies:
28
28
  name: mongoid
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ">="
31
+ - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '0'
33
+ version: '7.1'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
- - - ">="
38
+ - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '0'
40
+ version: '7.1'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: google-cloud-storage
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -83,7 +83,7 @@ files:
83
83
  - lib/fdarchivo/fdpath.rb
84
84
  - lib/fdarchivo/version.rb
85
85
  - lib/tasks/fdarchivo_tasks.rake
86
- homepage: http://www.forumdigital.es
86
+ homepage:
87
87
  licenses:
88
88
  - MIT
89
89
  metadata: {}
@@ -102,7 +102,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
102
102
  - !ruby/object:Gem::Version
103
103
  version: '0'
104
104
  requirements: []
105
- rubygems_version: 3.0.8
105
+ rubygems_version: 3.0.9
106
106
  signing_key:
107
107
  specification_version: 4
108
108
  summary: Summary of Fdarchivo.