rails_admin 1.0.0 → 1.1.0

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: b5f7c910bef240049b818e4189a241c41e68e180
4
- data.tar.gz: ea59f46605ddef6defbe19c6846d3d9ee6419166
3
+ metadata.gz: d27a09f1e2cf25bfca10937bcd279281e982f14b
4
+ data.tar.gz: 51952b4144d0ad13b3e7e5790b63cff53480502c
5
5
  SHA512:
6
- metadata.gz: c9c9d4bc637f60e21978c7ce73f693987de692177f79a61ab27757cd75b3ee531575d5bff729361d57c2fad35e82eb48763b5dc4a0c8615394569af7a2a5da5f
7
- data.tar.gz: 9f16f21be6393621ee9e3b3de88fa3c4c11e75d2d972b88fe411acc04625568adba1c580ede46ae97c012b637b1d75730b49515d3e0379ea8949806e78f851b2
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 (this.element.is(':visible')) {
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.type == :belongs_to_association && !f.polymorphic? }.collect { |f| f.association.name }
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)
@@ -31,6 +31,10 @@ module RailsAdmin
31
31
  true
32
32
  end
33
33
 
34
+ register_instance_option :eager_load? do
35
+ true
36
+ end
37
+
34
38
  def selected_id
35
39
  bindings[:object].send(foreign_key)
36
40
  end
@@ -45,6 +45,10 @@ module RailsAdmin
45
45
  [children_fields]
46
46
  end
47
47
 
48
+ register_instance_option :eager_load? do
49
+ false
50
+ end
51
+
48
52
  def associated_collection(type)
49
53
  return [] if type.blank?
50
54
  config = RailsAdmin.config(type)
@@ -1,7 +1,7 @@
1
1
  module RailsAdmin
2
2
  class Version
3
3
  MAJOR = 1
4
- MINOR = 0
4
+ MINOR = 1
5
5
  PATCH = 0
6
6
  PRE = nil
7
7
 
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.0.0
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-09-19 00:00:00.000000000 Z
15
+ date: 2016-10-30 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: builder