dynamic_scaffold 1.5.0 → 1.6.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ad52f099101bd86041d179bffaecf6618dd19066823e9c0309a4aa5323b04638
4
- data.tar.gz: bcf20b02b4afe8ea15c22753d1a02e9878a0d2c5db43bf6223b3e5a20e87da76
3
+ metadata.gz: c38dbab86d238886a3fc797a81804715a0b4299473cda34cbee0878f6c17500e
4
+ data.tar.gz: 9a2c173022936a56a7d6af715d60c71accadf070c9d34698af8a2512c841ee07
5
5
  SHA512:
6
- metadata.gz: 51d794aa0eeb3166b3fdd9a1d583d9e081498ef14e6314dcb2ab04863d4c29811774eccbf7f6f9f06a6953e29ca92088744505afd661513a2e13647bb4f4d6f4
7
- data.tar.gz: 481e2b94fe39f8aab2cb542f51ba9b923d170da1b9d15250675cae364f6c0e55c4e1f713edafc8f2112e525daf0fbb29698fc8924a26bccbe13c520a2fa04793
6
+ metadata.gz: 93cc76ad613015794c0cdbb260e0d2e94c5246997bbadffa9d89c18839224439f7101ab6ccafa42b1e740aa57288888db93a8fa87ff1ea6430404606b773c537
7
+ data.tar.gz: 842c32cce00a22e526bb1db3f9adc5f017ec188e5b8fd2ec0a91c693e999fc5e46de3272b80884cad0b60c27138afe31e17faeb89477540f905cabcd8ed77a53
@@ -1,6 +1,6 @@
1
1
  <%unless flash[:dynamic_scaffold_danger].nil? -%>
2
2
  <div class="alert alert-danger" role="alert">
3
- <%= flash[:dynamic_scaffold_danger] %>
3
+ <%== flash[:dynamic_scaffold_danger] %>
4
4
  </div>
5
5
  <%end%>
6
6
  <input type="hidden" class="authenticity_param_name" value="<%= request_forgery_protection_token %>">
@@ -77,7 +77,7 @@ module DynamicScaffold
77
77
  end
78
78
  end
79
79
 
80
- def update # rubocop:disable Metrics/AbcSize
80
+ def update # rubocop:disable Metrics/AbcSize, Metrics/MethodLength
81
81
  values = update_values
82
82
  @record = find_record(dynamic_scaffold.model.primary_key => params['id'])
83
83
  datetime_select_keys = []
@@ -107,7 +107,7 @@ module DynamicScaffold
107
107
  end
108
108
  end
109
109
 
110
- def destroy
110
+ def destroy # rubocop:disable Metrics/AbcSize
111
111
  # `Destroy` also does not support multiple primary keys too.
112
112
  record = find_record(dynamic_scaffold.model.primary_key => params['id'])
113
113
  begin
@@ -122,6 +122,9 @@ module DynamicScaffold
122
122
  flash[:dynamic_scaffold_danger] = I18n.t('dynamic_scaffold.alert.destroy.failed')
123
123
  logger.error(e)
124
124
  end
125
+
126
+ flash[:dynamic_scaffold_danger] = record.errors[:base].join('<br>') if record.errors[:base].any?
127
+
125
128
  redirect_to dynamic_scaffold_path(:index, request_queries)
126
129
  end
127
130
 
@@ -1,3 +1,3 @@
1
1
  module DynamicScaffold
2
- VERSION = '1.5.0'.freeze
2
+ VERSION = '1.6.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dynamic_scaffold
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Masamoto Miyata
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-04-16 00:00:00.000000000 Z
11
+ date: 2020-12-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: classnames-rails-view