active_scaffold 3.4.7 → 3.4.8
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.
- checksums.yaml +4 -4
- data/CHANGELOG +5 -1
- data/app/assets/javascripts/jquery/active_scaffold.js +15 -6
- data/lib/active_scaffold/actions/subform.rb +5 -0
- 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: b5de5babbd2447c2a706b2627e7e1cb09966e563
|
4
|
+
data.tar.gz: 371b743005cc81c284a673ee82e9fd23048bf8e3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1c3156bc03652f0b4efdfe075dd5019648ada5087474e17d49c6fdfd0bdf0e4dc1465eec783638154f22dcaa62d98eb9eeb54ce3b01b6ec04b732931bf495237
|
7
|
+
data.tar.gz: 797149d0738f3e7f995bd13e367fb589e8fa9956d1954b65b90b3e15925631a763ac630227df4ffb6c5c8ebbeb6b466571874601c841eee4506dd3868abc70b5
|
data/CHANGELOG
CHANGED
@@ -1,4 +1,8 @@
|
|
1
|
-
= 3.4.
|
1
|
+
= 3.4.8 (not released yet)
|
2
|
+
- set parent data when adding new record on subform of a create form on a embedded or nested list
|
3
|
+
- trigger ajax:* events on ajax call to render_field
|
4
|
+
|
5
|
+
= 3.4.7
|
2
6
|
- sorting by primary key added by default only for postgres, on mysql it will avoid using index to sort (you can see using filesort on explain), slowdown sorting
|
3
7
|
- fix set_parent on rails 3.2 with attr_accessible
|
4
8
|
- fix saving changes on render_field when blank row is changed and request render_field action
|
@@ -944,20 +944,29 @@ var ActiveScaffold = {
|
|
944
944
|
url: url,
|
945
945
|
data: params,
|
946
946
|
type: 'post',
|
947
|
-
beforeSend: function(
|
947
|
+
beforeSend: function(xhr, settings) {
|
948
948
|
element.nextAll('img.loading-indicator').css('visibility','visible');
|
949
949
|
ActiveScaffold.disable_form(as_form);
|
950
|
+
if ($.rails.fire(element, 'ajax:beforeSend', [xhr, settings])) {
|
951
|
+
element.trigger('ajax:send', xhr);
|
952
|
+
} else {
|
953
|
+
return false;
|
954
|
+
}
|
955
|
+
},
|
956
|
+
success: function(data, status, xhr) {
|
957
|
+
as_form.find('#'+element.attr('id')).trigger('ajax:success', [data, status, xhr]);
|
950
958
|
},
|
951
|
-
complete: function(
|
959
|
+
complete: function(xhr, status) {
|
960
|
+
element = as_form.find('#'+element.attr('id'));
|
952
961
|
element.nextAll('img.loading-indicator').css('visibility','hidden');
|
953
|
-
|
962
|
+
element.trigger('ajax:complete', [xhr, status]);
|
954
963
|
if (ActiveScaffold.last_focus) jQuery(ActiveScaffold.last_focus).focus().select();
|
955
964
|
},
|
956
965
|
error: function (xhr, status, error) {
|
966
|
+
element = as_form.find('#'+element.attr('id'));
|
957
967
|
var as_div = element.closest("div.active-scaffold");
|
958
|
-
if (as_div)
|
959
|
-
|
960
|
-
}
|
968
|
+
if (as_div) ActiveScaffold.report_500_response(as_div, xhr);
|
969
|
+
element.trigger('ajax:error', [xhr, status, error]);
|
961
970
|
}
|
962
971
|
});
|
963
972
|
},
|
@@ -9,6 +9,11 @@ module ActiveScaffold::Actions
|
|
9
9
|
|
10
10
|
def do_edit_associated
|
11
11
|
@parent_record = params[:id].nil? ? new_model : find_if_allowed(params[:id], :update)
|
12
|
+
if @parent_record.new_record?
|
13
|
+
apply_constraints_to_record @parent_record
|
14
|
+
create_association_with_parent @parent_record if nested?
|
15
|
+
end
|
16
|
+
|
12
17
|
generate_temporary_id(@parent_record, params[:generated_id]) if @parent_record.new_record? && params[:generated_id]
|
13
18
|
@column = active_scaffold_config.columns[params[:child_association]]
|
14
19
|
|
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.8
|
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: 2014-
|
11
|
+
date: 2014-11-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: shoulda
|