rails_admin 1.4.0 → 1.4.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of rails_admin might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 361208518b5b304581718ddc22d54ee97adcbaad
4
- data.tar.gz: 807e4d91a69a5377444885331a087e25ab65c891
3
+ metadata.gz: a17f479765c10aa74200405742f1387eea769ee8
4
+ data.tar.gz: b4efbfa19a87163d641b50aa4771b5eddddaa336
5
5
  SHA512:
6
- metadata.gz: 40e5f564f367ad3c53220737654301ff01df27ef448044d1d933397e3ac28d6fb2559e0dc6cfb4bbfe57cbc71194dcab9ea46ffcc263d3d71949a8935126f30a
7
- data.tar.gz: b08875e67144b03c5ab98789772067f6e3765c2e93e1d226800b742e68f685cbe5a829c04d35123560e98e80dcb2babbba9b1cb6b1c97a0fd2983968c461b436
6
+ metadata.gz: 20351d651d98ba0ac84171a0812b19394f5e2853598ae92a23069e979cea27b99161acfc9792621eb4da947539dc3d687371ad27832086f41740e77b6fe020c4
7
+ data.tar.gz: e00d12b32c662017293acff322855a9c6f5a479c151990664df3eac5568c6367c84fa4e908f6c5b3ebb6204b6bf78199ac22f304a01ca4bc4e291605e5df3e27
data/Gemfile CHANGED
@@ -23,7 +23,7 @@ group :test do
23
23
  gem 'coveralls'
24
24
  gem 'database_cleaner', ['>= 1.2', '!= 1.4.0', '!= 1.5.0']
25
25
  gem 'dragonfly', '~> 1.0'
26
- gem 'factory_girl', '>= 4.2'
26
+ gem 'factory_bot', '>= 4.2'
27
27
  gem 'generator_spec', '>= 0.8'
28
28
  gem 'launchy', '>= 2.2'
29
29
  gem 'mini_magick', '>= 3.4'
data/README.md CHANGED
@@ -100,6 +100,8 @@ This library aims to support and is [tested against][travis] the following Ruby
100
100
  * Ruby 2.1
101
101
  * Ruby 2.2
102
102
  * Ruby 2.3
103
+ * Ruby 2.4
104
+ * Ruby 2.5
103
105
  * [Rubinius][]
104
106
  * [JRuby][]
105
107
 
@@ -17,6 +17,10 @@ module RailsAdmin
17
17
  bindings[:view].content_tag(:pre) { formatted_value }.html_safe
18
18
  end
19
19
 
20
+ register_instance_option :export_value do
21
+ formatted_value
22
+ end
23
+
20
24
  def parse_value(value)
21
25
  value.present? ? JSON.parse(value) : nil
22
26
  end
@@ -24,11 +24,6 @@ module RailsAdmin
24
24
  end
25
25
 
26
26
  initializer 'RailsAdmin setup middlewares' do |app|
27
- app.config.session_store :cookie_store
28
- app.config.middleware.use ActionDispatch::Cookies
29
- app.config.middleware.use ActionDispatch::Flash
30
- app.config.middleware.use ActionDispatch::Session::CookieStore, app.config.session_options
31
- app.config.middleware.use Rack::MethodOverride
32
27
  app.config.middleware.use Rack::Pjax
33
28
  end
34
29
 
@@ -47,5 +42,24 @@ module RailsAdmin
47
42
  rake_tasks do
48
43
  Dir[File.join(File.dirname(__FILE__), '../tasks/*.rake')].each { |f| load f }
49
44
  end
45
+
46
+ initializer 'RailsAdmin check for required middlewares', after: :build_middleware_stack do |app|
47
+ has_session_store = app.config.middleware.to_a.any? { |m| m.klass.try(:<=, ActionDispatch::Session::AbstractStore) } || ::Rails.version < '5.0'
48
+ loaded = app.config.middleware.to_a.map(&:name)
49
+ required = %w(ActionDispatch::Cookies ActionDispatch::Flash Rack::MethodOverride)
50
+ missing = required - loaded
51
+ unless missing.empty? && has_session_store
52
+ configs = missing.map { |m| "config.middleware.use #{m}" }
53
+ configs << "config.middleware.use #{app.config.session_store.try(:name) || 'ActionDispatch::Session::CookieStore'}, #{app.config.session_options}" unless has_session_store
54
+ raise <<-EOM
55
+ Required middlewares for RailsAdmin are not added
56
+ To fix tihs, add
57
+
58
+ #{configs.join("\n ")}
59
+
60
+ to config/application.rb.
61
+ EOM
62
+ end
63
+ end
50
64
  end
51
65
  end
@@ -2,7 +2,7 @@ module RailsAdmin
2
2
  class Version
3
3
  MAJOR = 1
4
4
  MINOR = 4
5
- PATCH = 0
5
+ PATCH = 1
6
6
  PRE = nil
7
7
 
8
8
  class << self
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_admin
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Erik Michaels-Ober
@@ -12,7 +12,7 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2018-07-22 00:00:00.000000000 Z
15
+ date: 2018-08-19 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: builder