kadmin 0.7.4 → 0.7.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/components/kadmin/form.rb +18 -8
- data/app/views/layouts/kadmin/application.html.erb +1 -1
- data/lib/kadmin/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1c8bc1e06e324a0de09681425f5f96907db191b5
|
4
|
+
data.tar.gz: ec72b5e0e54dc188b411fc76fe86f567683e9ee7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2487fc63349161d22cfd69d841967cee42d562efb950ac577e7cf05374d9c6696a0e22445ae898dc9dc52ff8cf181aa20e5e4ab8ef5559ca42caf305b3be4891
|
7
|
+
data.tar.gz: cc9c2c4ccf1be78c2d8699831f01f16e1c0c3f252d9cf4481f9bd128a191749488a138a7a66b4cc508caa813158941ca1b5ccc1f6da32dccc09312daa3fad9b5
|
@@ -35,6 +35,10 @@ module Kadmin
|
|
35
35
|
# Also includes ActiveModel::Naming at the same time
|
36
36
|
extend ActiveModel::Translation
|
37
37
|
|
38
|
+
# Provides callback functionality similar to ActiveRecord
|
39
|
+
extend ActiveModel::Callbacks
|
40
|
+
define_model_callbacks :save
|
41
|
+
|
38
42
|
# @return [ActiveModel::Model] underlying model to populate
|
39
43
|
attr_reader :model
|
40
44
|
|
@@ -170,13 +174,17 @@ module Kadmin
|
|
170
174
|
|
171
175
|
def save
|
172
176
|
saved = false
|
177
|
+
# TODO: Check if the top level transaction is necessary here
|
178
|
+
# run_callbacks is already a transaction?
|
173
179
|
@model.class.transaction do
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
180
|
+
run_callbacks :save do
|
181
|
+
saved = @model.save
|
182
|
+
@associated_forms.values.flatten do |form|
|
183
|
+
saved &&= form.save
|
184
|
+
end
|
178
185
|
|
179
|
-
|
186
|
+
raise ActiveRecord::Rollback unless saved
|
187
|
+
end
|
180
188
|
end
|
181
189
|
|
182
190
|
return saved
|
@@ -185,9 +193,11 @@ module Kadmin
|
|
185
193
|
def save!
|
186
194
|
saved = false
|
187
195
|
@model.class.transaction do
|
188
|
-
|
189
|
-
|
190
|
-
|
196
|
+
run_callbacks :save do
|
197
|
+
saved = @model.save!
|
198
|
+
@associated_forms.values.flatten.each do |form|
|
199
|
+
saved &&= form.save! # no need to raise anything, save! will do so
|
200
|
+
end
|
191
201
|
end
|
192
202
|
end
|
193
203
|
|
@@ -7,7 +7,7 @@
|
|
7
7
|
<title>Apps/Services Admin</title>
|
8
8
|
<meta name="description" content="">
|
9
9
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
10
|
-
<link rel="apple-touch-icon" href="apple-touch-icon.png">
|
10
|
+
<link rel="apple-touch-icon" href="/apple-touch-icon.png">
|
11
11
|
<!-- Place favicon.ico in the root directory -->
|
12
12
|
<%= stylesheet_link_tag "kadmin/application", media: "all" %>
|
13
13
|
<%= yield :stylesheets %>
|
data/lib/kadmin/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kadmin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nicolas Pepin-Perreault
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2018-02-20 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rails
|
@@ -189,7 +189,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
189
189
|
version: '0'
|
190
190
|
requirements: []
|
191
191
|
rubyforge_project:
|
192
|
-
rubygems_version: 2.
|
192
|
+
rubygems_version: 2.5.2
|
193
193
|
signing_key:
|
194
194
|
specification_version: 4
|
195
195
|
summary: Collection of utility, configuration, etc., for admin areas
|