rails_admin 1.0.0 → 1.1.0
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 +4 -4
- data/app/assets/javascripts/rails_admin/ra.filtering-select.js +7 -8
- data/app/controllers/rails_admin/main_controller.rb +1 -1
- data/lib/rails_admin/config/fields/association.rb +4 -0
- data/lib/rails_admin/config/fields/types/belongs_to_association.rb +4 -0
- data/lib/rails_admin/config/fields/types/polymorphic_association.rb +4 -0
- data/lib/rails_admin/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d27a09f1e2cf25bfca10937bcd279281e982f14b
|
4
|
+
data.tar.gz: 51952b4144d0ad13b3e7e5790b63cff53480502c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fa0d0657963371052c1851983b8b371ce44171d215fce5f0d50ddd6d638bc543329930918b46172ff555fe558ff179d2b9fe45ab8326035ea031be61db4ebf93
|
7
|
+
data.tar.gz: 75e8e10ba79d3b1bec8515a9277ee2e613e70307d549f38136763c65c6d301f22348ef803e9d09fedbbffc4e01ad598eb48c847857cbc34e6503d572319ca8e5
|
@@ -33,22 +33,21 @@
|
|
33
33
|
select: null,
|
34
34
|
|
35
35
|
_create: function() {
|
36
|
-
var filtering_select
|
36
|
+
var filtering_select = this.element.siblings(
|
37
|
+
'[data-input-for="' + this.element.attr('id') + '"]'
|
38
|
+
);
|
37
39
|
|
38
40
|
// When using the browser back and forward buttons, it is possible that
|
39
41
|
// the autocomplete field will be cached which causes duplicate fields
|
40
42
|
// to be generated.
|
41
|
-
if (
|
43
|
+
if (filtering_select.size() > 0) {
|
44
|
+
this.input = filtering_select.children('input');
|
45
|
+
this.button = filtering_select.children('.input-group-btn');
|
46
|
+
} else {
|
42
47
|
this.element.hide();
|
43
48
|
filtering_select = this._inputGroup(this.element.attr('id'));
|
44
49
|
this.input = this._inputField();
|
45
50
|
this.button = this._buttonField();
|
46
|
-
} else {
|
47
|
-
filtering_select = this.element.siblings(
|
48
|
-
'[data-input-for="' + this.element.attr('id') + '"]'
|
49
|
-
);
|
50
|
-
this.input = filtering_select.children('input');
|
51
|
-
this.button = filtering_select.children('.input-group-btn');
|
52
51
|
}
|
53
52
|
|
54
53
|
this._setOptionsSource();
|
@@ -120,7 +120,7 @@ module RailsAdmin
|
|
120
120
|
end
|
121
121
|
|
122
122
|
def get_collection(model_config, scope, pagination)
|
123
|
-
associations = model_config.list.fields.select { |f| f.
|
123
|
+
associations = model_config.list.fields.select { |f| f.try(:eager_load?) }.collect { |f| f.association.name }
|
124
124
|
options = {}
|
125
125
|
options = options.merge(page: (params[Kaminari.config.param_name] || 1).to_i, per: (params[:per] || model_config.list.items_per_page)) if pagination
|
126
126
|
options = options.merge(include: associations) unless associations.blank?
|
@@ -62,6 +62,10 @@ module RailsAdmin
|
|
62
62
|
association.foreign_key_nullable?
|
63
63
|
end
|
64
64
|
|
65
|
+
register_instance_option :eager_load? do
|
66
|
+
!!searchable
|
67
|
+
end
|
68
|
+
|
65
69
|
# Reader for the association's child model's configuration
|
66
70
|
def associated_model_config
|
67
71
|
@associated_model_config ||= RailsAdmin.config(association.klass)
|
data/lib/rails_admin/version.rb
CHANGED
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
|
+
version: 1.1.0
|
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-
|
15
|
+
date: 2016-10-30 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: builder
|