active_scaffold 3.4.14 → 3.4.16
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +5 -0
- data/app/assets/javascripts/jquery/active_scaffold.js +5 -1
- data/lib/active_scaffold/actions/common_search.rb +0 -4
- data/lib/active_scaffold/actions/field_search.rb +2 -2
- data/lib/active_scaffold/actions/list.rb +10 -4
- data/lib/active_scaffold/actions/search.rb +1 -1
- data/lib/active_scaffold/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: 247539a2068b350fca651a90998fd9627de11326
|
4
|
+
data.tar.gz: fe55bfa49b3670fed3d8015034eab74343d80aab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 528632a5420784e879854874f60fad64d4705569021d9b57278cc2144d2301efbe2180176f23d7a521eb2cca1efe17f67abdf04cce45dc87ffed2ad4e20e16bc
|
7
|
+
data.tar.gz: 954b32ea74a131e29b0555612a9f2f444ccead1887a12d65be00bf80a3b14d8fca914152219603c7a31d7e3aaa63bedcd72d45118d8637246b0ef6281e19fe59
|
data/CHANGELOG
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
+
= 3.4.16
|
2
|
+
- add scoped_query to list methods, so it can be used for calculations, like each_record_in_scope is used to iterate over every filtered record
|
3
|
+
- fix field_search_ignore? and search_ignore?
|
4
|
+
- fix reset on search forms loaded with session search
|
5
|
+
|
1
6
|
= 3.4.14
|
2
7
|
- fix filter order in AS controllers which inherit from AS controllers
|
3
8
|
- clean code
|
@@ -127,7 +127,11 @@ jQuery(document).ready(function($) {
|
|
127
127
|
|
128
128
|
if (action_link && action_link.position) {
|
129
129
|
action_link.close();
|
130
|
-
} else if (link.hasClass('reset'))
|
130
|
+
} else if (link.hasClass('reset')) {
|
131
|
+
var form = link.closest('form');
|
132
|
+
if (form.is('.search')) form.find(':input:visible:not([type=submit])').val('');
|
133
|
+
else form.trigger('reset');
|
134
|
+
}
|
131
135
|
return true;
|
132
136
|
});
|
133
137
|
jQuery(document).on('ajax:error', 'a.as_cancel', function(event, xhr, status, error) {
|
@@ -38,10 +38,6 @@ module ActiveScaffold::Actions
|
|
38
38
|
def search_params
|
39
39
|
@search_params || active_scaffold_session_storage['search']
|
40
40
|
end
|
41
|
-
|
42
|
-
def global_search_ignore?
|
43
|
-
active_scaffold_config.list.always_show_search == true
|
44
|
-
end
|
45
41
|
|
46
42
|
# The default security delegates to ActiveRecordPermissions.
|
47
43
|
# You may override the method to customize.
|
@@ -73,8 +73,8 @@ module ActiveScaffold::Actions
|
|
73
73
|
end
|
74
74
|
end
|
75
75
|
|
76
|
-
def
|
77
|
-
active_scaffold_config.list.always_show_search ==
|
76
|
+
def field_search_ignore?
|
77
|
+
active_scaffold_config.list.always_show_search && active_scaffold_config.list.search_partial == 'field_search'
|
78
78
|
end
|
79
79
|
|
80
80
|
private
|
@@ -128,10 +128,16 @@ module ActiveScaffold::Actions
|
|
128
128
|
end
|
129
129
|
|
130
130
|
def each_record_in_scope
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
131
|
+
scoped_query.each {|record| yield record}
|
132
|
+
end
|
133
|
+
|
134
|
+
def scoped_query
|
135
|
+
@scoped_query ||= begin
|
136
|
+
do_search if respond_to? :do_search, true
|
137
|
+
set_includes_for_columns
|
138
|
+
# where(nil) is needed because we need a relation
|
139
|
+
append_to_query(beginning_of_chain.where(nil), finder_options)
|
140
|
+
end
|
135
141
|
end
|
136
142
|
|
137
143
|
# The default security delegates to ActiveRecordPermissions.
|
@@ -37,7 +37,7 @@ module ActiveScaffold::Actions
|
|
37
37
|
end
|
38
38
|
|
39
39
|
def search_ignore?
|
40
|
-
active_scaffold_config.list.always_show_search ==
|
40
|
+
active_scaffold_config.list.always_show_search && active_scaffold_config.list.search_partial == 'search'
|
41
41
|
end
|
42
42
|
|
43
43
|
private
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_scaffold
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.4.
|
4
|
+
version: 3.4.16
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Many, see README
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-01-
|
11
|
+
date: 2015-01-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: shoulda
|