ack_rails_admin_settings 1.1.4 → 1.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/app/models/rails_admin_settings/setting.rb +10 -0
- data/lib/generators/rails_admin_settings/migration_generator.rb +1 -2
- data/lib/rails_admin_settings/mongoid.rb +1 -1
- data/lib/rails_admin_settings/storage/carrierwave.rb +2 -2
- data/lib/rails_admin_settings/version.rb +1 -1
- data/lib/rails_admin_settings.rb +19 -0
- data/rails_admin_settings.gemspec +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1939049fc8ee3a45380834fb5a189636d1edc9ac
|
4
|
+
data.tar.gz: 20a4e16a772ba5050eae5eaa7cd0664ec332a38f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 372df93203fef4b55af2eaf404e942d3475f9a07d3c455884c9af377b7babaaac50f5ab374fe6a723cfe293b03ea8b41e0eb0e0834bad73dc574a420c434aa54
|
7
|
+
data.tar.gz: 4a9ebaccdd75eda63ac802986a755d8eb75607288520b814efa4ea6b5f700dbd7f0b722235601214362c9f9f0c7b254b2030c8ddf3353b7219ee45ca238b09cc
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
ack_rails_admin_settings (1.1.
|
4
|
+
ack_rails_admin_settings (1.1.5)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
@@ -53,7 +53,7 @@ GEM
|
|
53
53
|
erubis (2.7.0)
|
54
54
|
factory_girl (4.7.0)
|
55
55
|
activesupport (>= 3.0.0)
|
56
|
-
geocoder (1.
|
56
|
+
geocoder (1.4.0)
|
57
57
|
glebtv-carrierwave-mongoid (0.8.0)
|
58
58
|
carrierwave (>= 0.8.0, < 0.11.0)
|
59
59
|
mongoid (>= 3.0, < 5.0)
|
@@ -12,6 +12,16 @@ module RailsAdminSettings
|
|
12
12
|
include RailsAdminSettings::Mongoid
|
13
13
|
end
|
14
14
|
|
15
|
+
if defined?(Hancock)
|
16
|
+
include Hancock::RailsAdminPatch
|
17
|
+
def self.manager_can_default_actions
|
18
|
+
[:show, :read, :edit, :update]
|
19
|
+
end
|
20
|
+
def manager_cannot_actions
|
21
|
+
[:new, :create, :delete, :destroy]
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
15
25
|
if RailsAdminSettings.active_record?
|
16
26
|
self.table_name = "rails_admin_settings".freeze
|
17
27
|
end
|
@@ -6,10 +6,9 @@ module RailsAdminSettings
|
|
6
6
|
include ActiveRecord::Generators::Migration
|
7
7
|
source_root File.expand_path('../templates', __FILE__)
|
8
8
|
|
9
|
-
desc '
|
9
|
+
desc 'RailsAdminSettings migration generator'
|
10
10
|
def install
|
11
11
|
migration_template "migration.rb", "db/migrate/create_rails_admin_settings.rb"
|
12
12
|
end
|
13
13
|
end
|
14
14
|
end
|
15
|
-
|
@@ -16,7 +16,7 @@ module RailsAdminSettings
|
|
16
16
|
|
17
17
|
field :cache_keys_str, type: String, default: ""
|
18
18
|
def cache_keys
|
19
|
-
cache_keys_str.split(
|
19
|
+
cache_keys_str.split(/\s+/).map { |k| k.strip }.reject { |k| k.blank? }
|
20
20
|
end
|
21
21
|
|
22
22
|
after_save :clear_cache
|
@@ -2,8 +2,8 @@ module RailsAdminSettings
|
|
2
2
|
module Uploads
|
3
3
|
class CarrierWave < CarrierWave::Uploader::Base
|
4
4
|
def extension_white_list
|
5
|
-
%w(jpg jpeg gif png tiff psd ai txt rtf doc docx xls xlsx ppt pptx odt odx zip rar 7z pdf)
|
5
|
+
%w(jpg jpeg gif png tiff psd ai txt rtf doc docx xls xlsx ppt pptx odt odx zip rar 7z pdf).freeze
|
6
6
|
end
|
7
7
|
end
|
8
8
|
end
|
9
|
-
end
|
9
|
+
end
|
data/lib/rails_admin_settings.rb
CHANGED
@@ -55,11 +55,30 @@ module RailsAdminSettings
|
|
55
55
|
if ::Mongoid.const_defined?('History')
|
56
56
|
RailsAdminSettings::Setting.send(:include, ::Mongoid::History::Trackable)
|
57
57
|
RailsAdminSettings::Setting.send(:track_history, {track_create: true, track_destroy: true})
|
58
|
+
if Gem::Version.new(Rails.version) >= Gem::Version.new('5.0.0')
|
59
|
+
RailsAdminSettings::Setting.send(:belongs_to,
|
60
|
+
:modifier,
|
61
|
+
class_name: ::Mongoid::History.modifier_class_name,
|
62
|
+
optional: true
|
63
|
+
)
|
64
|
+
end
|
58
65
|
else
|
59
66
|
puts "[rails_admin_settings] WARN unable to track_history: Mongoid::History not loaded!".freeze
|
60
67
|
end
|
61
68
|
if ::Mongoid.const_defined?('Userstamp')
|
62
69
|
RailsAdminSettings::Setting.send(:include, ::Mongoid::Userstamp)
|
70
|
+
if Gem::Version.new(Rails.version) >= Gem::Version.new('5.0.0')
|
71
|
+
RailsAdminSettings::Setting.send(:belongs_to,
|
72
|
+
::Mongoid::Userstamp.config.creator_field,
|
73
|
+
class_name: ::Mongoid::Userstamp.config.user_model_name,
|
74
|
+
optional: true
|
75
|
+
)
|
76
|
+
RailsAdminSettings::Setting.send(:belongs_to,
|
77
|
+
::Mongoid::Userstamp.config.updater_field,
|
78
|
+
class_name: ::Mongoid::Userstamp.config.user_model_name,
|
79
|
+
optional: true
|
80
|
+
)
|
81
|
+
end
|
63
82
|
else
|
64
83
|
puts "[rails_admin_settings] WARN unable to track_history: Mongoid::Userstamp not loaded!".freeze
|
65
84
|
end
|
@@ -10,7 +10,7 @@ Gem::Specification.new do |spec|
|
|
10
10
|
spec.email = ['i43ack@gmail.com', "glebtv@gmail.com"]
|
11
11
|
spec.description = %q{Mongoid / ActiveRecord + RailsAdmin App Settings management}
|
12
12
|
spec.summary = %q{}
|
13
|
-
spec.homepage = "https://github.com/
|
13
|
+
spec.homepage = "https://github.com/red-rocks/rails_admin_settings"
|
14
14
|
spec.license = "MIT"
|
15
15
|
|
16
16
|
spec.files = `git ls-files`.split($/)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ack_rails_admin_settings
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alexander Kiseliev
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-09-
|
12
|
+
date: 2016-09-09 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: mongoid
|
@@ -336,7 +336,7 @@ files:
|
|
336
336
|
- spec/support/mongoid.rb
|
337
337
|
- spec/support/mongoid.yml
|
338
338
|
- spec/types_spec.rb
|
339
|
-
homepage: https://github.com/
|
339
|
+
homepage: https://github.com/red-rocks/rails_admin_settings
|
340
340
|
licenses:
|
341
341
|
- MIT
|
342
342
|
metadata: {}
|