rails_admin_settings 0.3.7 → 0.3.8

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -51,8 +51,11 @@ Or install it yourself as:
51
51
 
52
52
  Settings.content_block_1(mode: 'html', default: 'test')
53
53
  Settings.data(mode: 'yaml')
54
- Settings.enabled?(:data, type: 'phone') # also creates setting if it doesn't exist
55
54
  Settings.data = [1, 2, 3]
55
+
56
+ Settings.enabled?(:phone, type: 'phone', default: '906 111-11-11') # also creates setting if it doesn't exist
57
+ Settings.phone.area
58
+ Settings.phone.subscriber
56
59
 
57
60
  See more here: https://github.com/rs-pro/rails_admin_settings/blob/master/spec/advanced_usage_spec.rb
58
61
 
@@ -7,6 +7,16 @@ class Settings
7
7
  @@loaded = false
8
8
  @@settings = {}
9
9
 
10
+ def file_uploads_supported
11
+ load!
12
+ @@file_uploads_supported
13
+ end
14
+
15
+ def file_uploads_engine
16
+ load!
17
+ @@file_uploads_engine
18
+ end
19
+
10
20
  def load!
11
21
  if @@loaded
12
22
  false
@@ -11,7 +11,8 @@ module RailsAdminSettings
11
11
  Settings.file_uploads_supported = true
12
12
  Settings.file_uploads_engine = :carrierwave
13
13
  # paperclip
14
- elsif base.respond_to?(:has_mongoid_attached_file)
14
+ elsif Mongoid.const_defined?('Paperclip')
15
+ base.send(:include, Mongoid::Paperclip)
15
16
  # puts "[rails_admin_settings] PaperClip detected"
16
17
  base.field(:file, type: String)
17
18
  base.has_mongoid_attached_file(:file)
@@ -1,3 +1,3 @@
1
1
  module RailsAdminSettings
2
- VERSION = "0.3.7"
2
+ VERSION = "0.3.8"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_admin_settings
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.7
4
+ version: 0.3.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-03-24 00:00:00.000000000 Z
12
+ date: 2013-03-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: mongoid
@@ -290,7 +290,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
290
290
  version: '0'
291
291
  segments:
292
292
  - 0
293
- hash: -2837920607569123901
293
+ hash: -511900026411857171
294
294
  required_rubygems_version: !ruby/object:Gem::Requirement
295
295
  none: false
296
296
  requirements:
@@ -299,7 +299,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
299
299
  version: '0'
300
300
  segments:
301
301
  - 0
302
- hash: -2837920607569123901
302
+ hash: -511900026411857171
303
303
  requirements: []
304
304
  rubyforge_project:
305
305
  rubygems_version: 1.8.25