rails_admin 1.1.0 → 1.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.

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: d27a09f1e2cf25bfca10937bcd279281e982f14b
4
- data.tar.gz: 51952b4144d0ad13b3e7e5790b63cff53480502c
3
+ metadata.gz: d80a5575faa7784d6f5d17ddebb05038a5416969
4
+ data.tar.gz: c30c5b1ffb5839b5b387b7935e7ed201966efdbb
5
5
  SHA512:
6
- metadata.gz: fa0d0657963371052c1851983b8b371ce44171d215fce5f0d50ddd6d638bc543329930918b46172ff555fe558ff179d2b9fe45ab8326035ea031be61db4ebf93
7
- data.tar.gz: 75e8e10ba79d3b1bec8515a9277ee2e613e70307d549f38136763c65c6d301f22348ef803e9d09fedbbffc4e01ad598eb48c847857cbc34e6503d572319ca8e5
6
+ metadata.gz: ee5a0326bd91f3b04e1b7711cddb648772bbc29f47f76784a69508fcfa3bf590528321b86faddace87c3bd1d6334100e0fea04cf18dbd04ecf6bd3e3ed2c85e9
7
+ data.tar.gz: 4565950fa8e26c5c5b7a0d79cb522e91d1256575287e7b637165c2c03b82053461aa3e6317479c5ca2340439b5a9d8e4e5768efe52939b7d32b1bb1cfd443919
data/Gemfile CHANGED
@@ -18,8 +18,6 @@ group :active_record do
18
18
  gem 'pg', '>= 0.14'
19
19
  gem 'sqlite3', '>= 1.3'
20
20
  end
21
-
22
- gem 'paper_trail', '>= 5.0'
23
21
  end
24
22
 
25
23
  group :development, :test do
data/README.md CHANGED
@@ -16,6 +16,15 @@
16
16
 
17
17
  RailsAdmin is a Rails engine that provides an easy-to-use interface for managing your data.
18
18
 
19
+ ## Announcements
20
+
21
+ ### [Action required] Security issue
22
+
23
+ **RailsAdmin 1.0.0 and 1.1.0 have been reported to have CSRF vulnerability with default setup.** We strongly recommend that you upgrade RailsAdmin to 1.1.1 or later as soon as possible, if you are on these versions. See [b13e879e](https://github.com/sferik/rails_admin/commit/b13e879eb93b661204e9fb5e55f7afa4f397537a) for the detail.
24
+
25
+ This problem was reported by SourceClear, Inc.
26
+
27
+
19
28
  ## Features
20
29
  * CRUD any data with ease
21
30
  * Custom actions
@@ -11,6 +11,8 @@ module RailsAdmin
11
11
  end
12
12
 
13
13
  class ApplicationController < Config.parent_controller.constantize
14
+ protect_from_forgery with: :exception
15
+
14
16
  before_action :_authenticate!
15
17
  before_action :_authorize!
16
18
  before_action :_audit!
@@ -63,12 +65,14 @@ module RailsAdmin
63
65
  rescue_from RailsAdmin::ObjectNotFound do
64
66
  flash[:error] = I18n.t('admin.flash.object_not_found', model: @model_name, id: params[:id])
65
67
  params[:action] = 'index'
68
+ @status_code = :not_found
66
69
  index
67
70
  end
68
71
 
69
72
  rescue_from RailsAdmin::ModelNotFound do
70
73
  flash[:error] = I18n.t('admin.flash.model_not_found', model: @model_name)
71
74
  params[:action] = 'dashboard'
75
+ @status_code = :not_found
72
76
  dashboard
73
77
  end
74
78
  end
@@ -1,4 +1,4 @@
1
- if defined?(::ActiveRecord)
1
+ ActiveSupport.on_load(:active_record) do
2
2
  module ActiveRecord
3
3
  class Base
4
4
  def self.rails_admin(&block)
@@ -72,6 +72,8 @@ module RailsAdmin
72
72
  ::ActiveRecord::Base.connection.select_one("SELECT ''::text AS str;").values.first.encoding
73
73
  when 'mysql2'
74
74
  ::ActiveRecord::Base.connection.instance_variable_get(:@connection).encoding
75
+ when 'oracle_enhanced'
76
+ ::ActiveRecord::Base.connection.select_one("SELECT dummy FROM DUAL").values.first.encoding
75
77
  else
76
78
  ::ActiveRecord::Base.connection.select_one("SELECT '' AS str;").values.first.encoding
77
79
  end
@@ -30,7 +30,7 @@ module RailsAdmin
30
30
  @most_recent_created[t.model.name] = t.model.last.try(:created_at)
31
31
  end
32
32
  end
33
- render @action.template_name, status: (flash[:error].present? ? :not_found : 200)
33
+ render @action.template_name, status: @status_code || :ok
34
34
  end
35
35
  end
36
36
 
@@ -41,7 +41,7 @@ module RailsAdmin
41
41
 
42
42
  respond_to do |format|
43
43
  format.html do
44
- render @action.template_name, status: (flash[:error].present? ? :not_found : 200)
44
+ render @action.template_name, status: @status_code || :ok
45
45
  end
46
46
 
47
47
  format.json do
@@ -4,6 +4,9 @@ require 'csv'
4
4
  module RailsAdmin
5
5
  class CSVConverter
6
6
  def initialize(objects = [], schema = {})
7
+ @fields = []
8
+ @associations = []
9
+
7
10
  return self if (@objects = objects).blank?
8
11
 
9
12
  @model = objects.dup.first.class
@@ -32,6 +35,7 @@ module RailsAdmin
32
35
  end
33
36
 
34
37
  def to_csv(options = {})
38
+ options = HashWithIndifferentAccess.new(options)
35
39
  encoding_to = Encoding.find(options[:encoding_to]) if options[:encoding_to].present?
36
40
 
37
41
  csv_string = generate_csv_string(options)
@@ -2,7 +2,7 @@ module RailsAdmin
2
2
  class Version
3
3
  MAJOR = 1
4
4
  MINOR = 1
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.1.0
4
+ version: 1.1.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: 2016-10-30 00:00:00.000000000 Z
15
+ date: 2016-12-25 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: builder