activeadmin_settings_cached 2.1.0 → 2.1.1
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 +4 -4
- data/.gitignore +1 -1
- data/.travis.yml +10 -4
- data/Appraisals +5 -7
- data/CHANGELOG.md +94 -0
- data/Gemfile +1 -1
- data/Makefile +3 -0
- data/README.md +19 -3
- data/Rakefile +11 -0
- data/activeadmin_settings_cached.gemspec +1 -1
- data/app/views/admin/settings/_index.html.erb +1 -1
- data/gemfiles/rails4.2.gemfile +13 -0
- data/gemfiles/rails5.0.gemfile +15 -0
- data/lib/activeadmin_settings_cached/coercions.rb +1 -1
- data/lib/activeadmin_settings_cached/dsl.rb +1 -1
- data/lib/activeadmin_settings_cached/version.rb +1 -1
- data/lib/generators/active_admin/{settings/USAGE → USAGE} +1 -1
- data/lib/generators/active_admin/{settings/settings_generator.rb → settings_generator.rb} +1 -1
- data/lib/generators/active_admin/{settings/templates → templates}/settings.rb +0 -0
- data/spec/spec_helper.rb +1 -1
- metadata +17 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3736a48cf8b4b7548d4910266581a3fc9eebcba3
|
4
|
+
data.tar.gz: de7634b92e52bbfa8b31e6e208d58a8400b8afe4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6f4d640a6c4eed94608f5b8478bc81c40217b7c656d2db06571da6045f70a08c77e5e3c809b822a2353e3b734838d44f1bd7a01c6fa92883694e48f47a16db07
|
7
|
+
data.tar.gz: 25d94d5d0e3ed2ebb2384be24793a004b0d295df0eccf244d8ae2552ba63bd3dad1ceca9ce15b196653aeb74913d613c6e51107d10c291da240a7d9c55efce7d
|
data/.gitignore
CHANGED
data/.travis.yml
CHANGED
@@ -1,10 +1,16 @@
|
|
1
1
|
language: ruby
|
2
2
|
cache: bundler
|
3
3
|
|
4
|
+
gemfile:
|
5
|
+
- gemfiles/rails4.2.gemfile
|
6
|
+
- gemfiles/rails5.0.gemfile
|
7
|
+
|
8
|
+
before_script:
|
9
|
+
- bundle exec rake setup
|
10
|
+
|
4
11
|
script:
|
5
|
-
-
|
12
|
+
- bundle exec rake
|
6
13
|
|
7
14
|
rvm:
|
8
|
-
|
9
|
-
|
10
|
-
- 2.3.0
|
15
|
+
- 2.2.6
|
16
|
+
- 2.3.3
|
data/Appraisals
CHANGED
@@ -2,10 +2,8 @@ appraise "rails4.2" do
|
|
2
2
|
gem "rails", "~> 4.2.0"
|
3
3
|
end
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
#gem 'sass-rails', github: 'rails/sass-rails' # For Sprockets 4
|
11
|
-
#end
|
5
|
+
appraise "rails5.0" do
|
6
|
+
gem "rails", "~> 5.0.1"
|
7
|
+
gem 'inherited_resources', git: 'https://github.com/activeadmin/inherited_resources.git'
|
8
|
+
gem 'listen'
|
9
|
+
end
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,94 @@
|
|
1
|
+
# v2.1.1 2017-08-07
|
2
|
+
|
3
|
+
## Fixed
|
4
|
+
|
5
|
+
- Fix generator (Alexander Merkulov)
|
6
|
+
- Fix i18n label content and 'for' attribute (Tom Richards)
|
7
|
+
|
8
|
+
# v2.1.0 2016-12-16
|
9
|
+
|
10
|
+
## Added
|
11
|
+
|
12
|
+
- Allow to use key option to configure `starting_with` option name (Alexander Merkulov)
|
13
|
+
- German translation (Flyte222)
|
14
|
+
|
15
|
+
## Changed
|
16
|
+
|
17
|
+
- Default model name is `Setting` instead `Settings`
|
18
|
+
|
19
|
+
# v2.0.1 2016-04-25
|
20
|
+
|
21
|
+
- Freeze right border for `rails-settings-cached` to `< 0.5.5`
|
22
|
+
|
23
|
+
# v2.0.0 2016-04-25
|
24
|
+
|
25
|
+
## Added
|
26
|
+
|
27
|
+
- Added DSL and multiply settings panels functionality (Alexander Merkulov)
|
28
|
+
|
29
|
+
## Changed
|
30
|
+
|
31
|
+
- Simplify localization, example
|
32
|
+
|
33
|
+
```
|
34
|
+
en:
|
35
|
+
settings:
|
36
|
+
attributes:
|
37
|
+
my_awesome_settings: 'My Awesome Lolaized Setting'
|
38
|
+
```
|
39
|
+
|
40
|
+
# v1.0.1 2015-10-25
|
41
|
+
|
42
|
+
## Fixed
|
43
|
+
|
44
|
+
- Fix show settings in admin
|
45
|
+
|
46
|
+
# v1.0.0 2015-09-29
|
47
|
+
|
48
|
+
## Added
|
49
|
+
|
50
|
+
- Allow to configure how display options
|
51
|
+
|
52
|
+
# v0.1.0 2015-08-31
|
53
|
+
|
54
|
+
## Added
|
55
|
+
|
56
|
+
- Added labels to form fields (Derek Kniffin)
|
57
|
+
|
58
|
+
# v0.1.0 2015-08-03
|
59
|
+
|
60
|
+
## Added
|
61
|
+
|
62
|
+
- Show flash message after save settings
|
63
|
+
|
64
|
+
## Fixed
|
65
|
+
|
66
|
+
- Use proc for display settings name (Dmitry Krakosevich)
|
67
|
+
|
68
|
+
# v0.0.5 2015-06-04
|
69
|
+
|
70
|
+
## Fixed
|
71
|
+
|
72
|
+
- Display settings name if translation is missing (Lunar Farside)
|
73
|
+
|
74
|
+
# v0.0.4 2015-05-17
|
75
|
+
|
76
|
+
## Added
|
77
|
+
|
78
|
+
- Added en local (dixalex)
|
79
|
+
|
80
|
+
# v0.0.3 2015-04-30
|
81
|
+
|
82
|
+
## Fixed
|
83
|
+
|
84
|
+
- Unlock Active Admin dependency
|
85
|
+
|
86
|
+
# v0.0.2 2014-11-30
|
87
|
+
|
88
|
+
## Fixed
|
89
|
+
|
90
|
+
- Fix Active Admin version
|
91
|
+
|
92
|
+
# v0.0.1 2014-11-30
|
93
|
+
|
94
|
+
First public release
|
data/Gemfile
CHANGED
data/Makefile
CHANGED
data/README.md
CHANGED
@@ -3,6 +3,7 @@
|
|
3
3
|
[](http://badge.fury.io/rb/activeadmin_settings_cached)
|
4
4
|
[](https://travis-ci.org/artofhuman/activeadmin_settings_cached)
|
5
5
|
[](https://gemnasium.com/github.com/artofhuman/activeadmin_settings_cached)
|
6
|
+
[](https://coveralls.io/github/artofhuman/activeadmin_settings_cached?branch=master)
|
6
7
|
|
7
8
|
Provides a nice UI interface for [rails-settings-cached](https://github.com/huacnlee/rails-settings-cached) gem in [Active Admin](http://activeadmin.info/).
|
8
9
|
|
@@ -25,13 +26,28 @@ Create your settings model:
|
|
25
26
|
|
26
27
|
Create your settings page:
|
27
28
|
|
28
|
-
|
29
|
+
# From generators
|
30
|
+
$ rails g active_admin:settings Setting
|
31
|
+
|
32
|
+
# Or manual
|
33
|
+
|
34
|
+
``` ruby
|
35
|
+
# app/admin/setting.rb
|
36
|
+
ActiveAdmin.register_page 'Setting' do
|
37
|
+
title = 'Settings'
|
38
|
+
menu label: title
|
39
|
+
|
40
|
+
active_admin_settings_page(
|
41
|
+
title: title
|
42
|
+
)
|
43
|
+
end
|
44
|
+
```
|
29
45
|
|
30
46
|
And configure your default values in your Settings model:
|
31
47
|
|
32
48
|
``` ruby
|
33
49
|
class Settings < RailsSettings::CachedSettings
|
34
|
-
|
50
|
+
defaults[:my_awesome_settings] = 'This is my settings'
|
35
51
|
end
|
36
52
|
```
|
37
53
|
|
@@ -71,7 +87,7 @@ en:
|
|
71
87
|
```
|
72
88
|
## Model name
|
73
89
|
|
74
|
-
By default the name of the mode is `
|
90
|
+
By default the name of the mode is `Setting`. If you want to use a different name for the model, you can specify your that in `config/initializers/active_admin_settings_cached.rb`:
|
75
91
|
|
76
92
|
``` ruby
|
77
93
|
ActiveadminSettingsCached.configure do |config|
|
data/Rakefile
CHANGED
@@ -5,3 +5,14 @@ Bundler::GemHelper.install_tasks
|
|
5
5
|
|
6
6
|
# Import all our rake tasks
|
7
7
|
FileList['tasks/**/*.rake'].each { |task| import task }
|
8
|
+
|
9
|
+
require 'rspec/core/rake_task'
|
10
|
+
|
11
|
+
RSpec::Core::RakeTask.new do |t|
|
12
|
+
t.pattern = 'spec/**/*_spec.rb'
|
13
|
+
t.ruby_opts = %w[]
|
14
|
+
t.verbose = false
|
15
|
+
end
|
16
|
+
|
17
|
+
desc 'Default: run the rspec examples'
|
18
|
+
task :default => [:spec]
|
@@ -18,7 +18,7 @@ Gem::Specification.new do |s|
|
|
18
18
|
s.test_files = s.files.grep(%r{^(test|spec|features)/})
|
19
19
|
s.require_paths = ["lib"]
|
20
20
|
|
21
|
-
s.add_dependency 'activeadmin'
|
21
|
+
s.add_dependency 'activeadmin', '>= 1.0.0.pre4', '< 1.2.0'
|
22
22
|
s.add_dependency 'rails-settings-cached', '>= 0.5.3', '< 0.6.6'
|
23
23
|
s.add_dependency 'dry-types', '>= 0.8.1'
|
24
24
|
|
@@ -11,7 +11,7 @@
|
|
11
11
|
<% settings_model.settings.each_pair do |name, _| %>
|
12
12
|
<% field_name = settings_model.field_name(name) %>
|
13
13
|
<tr class="odd">
|
14
|
-
<td><strong><%= f.label t("settings.attributes.#{field_name}", default: field_name) %></strong></td>
|
14
|
+
<td><strong><%= f.label field_name, t("settings.attributes.#{field_name}", default: field_name) %></strong></td>
|
15
15
|
<td>
|
16
16
|
<div class='form'>
|
17
17
|
<ol><%= f.input field_name, settings_model.field_options(field_name, name) %></ol>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
# This file was generated by Appraisal
|
2
|
+
|
3
|
+
source "https://rubygems.org"
|
4
|
+
|
5
|
+
gem "rails", "~> 4.2.0"
|
6
|
+
|
7
|
+
group :test do
|
8
|
+
gem "pry-byebug"
|
9
|
+
gem "therubyracer"
|
10
|
+
gem "activeadmin", :git => "https://github.com/activeadmin/activeadmin.git"
|
11
|
+
end
|
12
|
+
|
13
|
+
gemspec :path => "../"
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# This file was generated by Appraisal
|
2
|
+
|
3
|
+
source "https://rubygems.org"
|
4
|
+
|
5
|
+
gem "rails", "~> 5.0.1"
|
6
|
+
gem "inherited_resources", :git => "https://github.com/activeadmin/inherited_resources.git"
|
7
|
+
gem "listen"
|
8
|
+
|
9
|
+
group :test do
|
10
|
+
gem "pry-byebug"
|
11
|
+
gem "therubyracer"
|
12
|
+
gem "activeadmin", :git => "https://github.com/activeadmin/activeadmin.git"
|
13
|
+
end
|
14
|
+
|
15
|
+
gemspec :path => "../"
|
@@ -31,7 +31,7 @@ module ActiveadminSettingsCached
|
|
31
31
|
end
|
32
32
|
|
33
33
|
flash[:success] = t('activeadmin_settings_cached.settings.update.success'.freeze)
|
34
|
-
|
34
|
+
Rails.version.to_i >= 5 ? redirect_back(fallback_location: admin_root_path) : redirect_to(:back)
|
35
35
|
end
|
36
36
|
|
37
37
|
instance_eval(&block) if block_given?
|
File without changes
|
data/spec/spec_helper.rb
CHANGED
@@ -16,7 +16,7 @@ require 'rails'
|
|
16
16
|
ENV['RAILS'] = Rails.version
|
17
17
|
ENV['RAILS_ROOT'] = File.expand_path("../rails/rails-#{ENV['RAILS']}", __FILE__)
|
18
18
|
# Create the test app if it doesn't exists
|
19
|
-
unless File.
|
19
|
+
unless File.exist?(ENV['RAILS_ROOT'])
|
20
20
|
system 'rake setup'
|
21
21
|
end
|
22
22
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activeadmin_settings_cached
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.1.
|
4
|
+
version: 2.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Semyon Pupkov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-08-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activeadmin
|
@@ -16,14 +16,20 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 1.0.0.pre4
|
20
|
+
- - "<"
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: 1.2.0
|
20
23
|
type: :runtime
|
21
24
|
prerelease: false
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
23
26
|
requirements:
|
24
27
|
- - ">="
|
25
28
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
29
|
+
version: 1.0.0.pre4
|
30
|
+
- - "<"
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: 1.2.0
|
27
33
|
- !ruby/object:Gem::Dependency
|
28
34
|
name: rails-settings-cached
|
29
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -209,6 +215,7 @@ files:
|
|
209
215
|
- ".rspec"
|
210
216
|
- ".travis.yml"
|
211
217
|
- Appraisals
|
218
|
+
- CHANGELOG.md
|
212
219
|
- Dockerfile
|
213
220
|
- Gemfile
|
214
221
|
- LICENSE.txt
|
@@ -221,6 +228,8 @@ files:
|
|
221
228
|
- config/locales/en.yml
|
222
229
|
- config/locales/ru.yml
|
223
230
|
- docker-compose.yml
|
231
|
+
- gemfiles/rails4.2.gemfile
|
232
|
+
- gemfiles/rails5.0.gemfile
|
224
233
|
- lib/activeadmin_settings_cached.rb
|
225
234
|
- lib/activeadmin_settings_cached/coercions.rb
|
226
235
|
- lib/activeadmin_settings_cached/dsl.rb
|
@@ -228,9 +237,9 @@ files:
|
|
228
237
|
- lib/activeadmin_settings_cached/model.rb
|
229
238
|
- lib/activeadmin_settings_cached/options.rb
|
230
239
|
- lib/activeadmin_settings_cached/version.rb
|
231
|
-
- lib/generators/active_admin/
|
232
|
-
- lib/generators/active_admin/
|
233
|
-
- lib/generators/active_admin/
|
240
|
+
- lib/generators/active_admin/USAGE
|
241
|
+
- lib/generators/active_admin/settings_generator.rb
|
242
|
+
- lib/generators/active_admin/templates/settings.rb
|
234
243
|
- spec/coercions_spec.rb
|
235
244
|
- spec/model_spec.rb
|
236
245
|
- spec/settings_spec.rb
|
@@ -258,7 +267,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
258
267
|
version: '0'
|
259
268
|
requirements: []
|
260
269
|
rubyforge_project:
|
261
|
-
rubygems_version: 2.
|
270
|
+
rubygems_version: 2.6.8
|
262
271
|
signing_key:
|
263
272
|
specification_version: 4
|
264
273
|
summary: UI interface for rails-settings-cached in active admin
|