el_finder2 0.1.4 → 0.1.5

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: ff59a1ef1adf040108a8458744fcadca984298a3
4
- data.tar.gz: a2d3ff1f92269aa7b9b94b0313233d4335fddb8e
3
+ metadata.gz: b013a2eae693a7e0bb6a91467935ce26404f5dca
4
+ data.tar.gz: ae780424d87bbd3dea9456ff41b000fdc927f843
5
5
  SHA512:
6
- metadata.gz: 74bf38071a64e6d5d128c885c56376c4d96b1a4252126483c83b1bb25dfef9efdbc0f104dcebf84c2b7af4f89f3ef19bf0b422ff7789db1f70f24f6cda825e4e
7
- data.tar.gz: c7c059cfec7dcb13e10e1a54ef04d0582a05667d925c26ae127413ff92be311ff7ff83b50ce5baa8996c284a58898cafcf35d8c131a8302348611a3ba1c8f910
6
+ metadata.gz: d425c81e0ac8fac2d239025e79c4801d4f966729eae72708a0149a897c3ed5ce2d802fdc570a93f30131ac7d64b7ea296743296800199f90c7da4bb365e6e97a
7
+ data.tar.gz: f908348e6f1f80245583296a054bd19fb67c5223716a47f9d0644dcab405df06b163e7ec7743a7a5145d6e6b2a8df9360dd066cffbcbebb0a700ba24fc289dd8
@@ -1,6 +1,6 @@
1
1
  module ElFinder2
2
2
  class Document < ElFinder2::File
3
- has_attached_file :content
3
+ has_attached_file :content, ElFinder2.configuration.document_attachment
4
4
 
5
5
  validates_attachment :content, ElFinder2.configuration.document_validations
6
6
 
@@ -1,3 +1,3 @@
1
1
  module ElFinder2
2
- VERSION = '0.1.4'
2
+ VERSION = '0.1.5'
3
3
  end
data/lib/el_finder2.rb CHANGED
@@ -18,29 +18,34 @@ module ElFinder2
18
18
 
19
19
  class Configuration
20
20
  attr_accessor :document_validations
21
- attr_accessor :image_styles
22
21
  attr_accessor :image_validations
23
- attr_accessor :paperclip_defaults
22
+ attr_accessor :document_options
23
+ attr_accessor :image_options
24
+ attr_accessor :default_options
24
25
 
25
26
  def initialize
26
27
  @document_validations = {
27
28
  presence: true,
28
29
  file_type_ignorance: {}
29
30
  }
30
- @image_styles = { thumb: '100x100>' }
31
31
  @image_validations = {
32
32
  presence: true,
33
33
  content_type: { content_type: ElFinder2::IMAGE_MIME_REGEX }
34
34
  }
35
- @paperclip_defaults = {}
35
+
36
+ @default_options = {}
37
+ @image_options = {
38
+ styles: { thumb: '100x100>' }
39
+ }
40
+ @document_options = {}
36
41
  end
37
42
 
38
43
  def image_attachment
39
- @paperclip_defaults.merge(styles: @image_styles)
44
+ @default_options.merge(@image_options)
40
45
  end
41
46
 
42
47
  def document_attachment
43
- @paperclip_defaults
48
+ @default_options.merge(@document_options)
44
49
  end
45
50
  end
46
51
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: el_finder2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - QuintEvents