corn_starch 1.8.22 → 1.8.23

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
  SHA1:
3
- metadata.gz: 37ec6a3adb7438d9a4db8a0318886217bc5d6d73
4
- data.tar.gz: 2dc2a7ca8ec54cff4b9684640e4df70b2ed9f822
3
+ metadata.gz: 7c53e0cae3e2454ae6bbe227d0166c5d17a8bed3
4
+ data.tar.gz: e1ec042442c9ded5d1da8064d587e3fb47d1d628
5
5
  SHA512:
6
- metadata.gz: 3f539b97f9b443e3b5a6225d0bcf13a2be2458b6d7027ad151063b22ef4908fec4e23023255211348d17612b60648386ff2409fe3b35f5194ff73b45cafcd2d3
7
- data.tar.gz: 3ff936f86df35e363217828eef5b3c1f2f0f7ca538014a3e5182376eb4bf41b76f9fbc22914878bddb99975956076d796e936925ed6902eb9e1afe23dc8563fb
6
+ metadata.gz: 4a85535b8a19691226c0b71c07258f9d08f8dc911985015650951d7a504bcba9ecff96bed7ecf840c135b0cc1a0e2418e3e43d262f3124fe9bf4d8ed618fd295
7
+ data.tar.gz: db8065f39ae058bfad2beb309250e7f0bc15a7df0003c31fb94cf385c3b6b42fcc45f00c6d84628b11c3ddb29407b0342bd531a6af074f9832578f6d87440a2c
@@ -239,6 +239,9 @@ module CornStarch
239
239
  uname = current_user ? current_user.display_name : ''
240
240
  ename = entity ? entity.display_name : ''
241
241
 
242
+ # Acquire Errors
243
+ errors = entity.try(:errors).try(:collect) { |e| "\n - #{e}" }.try :join
244
+
242
245
  # Switch on Action
243
246
  case action
244
247
 
@@ -255,12 +258,12 @@ module CornStarch
255
258
  when :create
256
259
  {
257
260
  pass: { head: t('gen_msg.create.pass.head', model: model), body: t('gen_msg.create.pass.body', model: model, name: ename) },
258
- fail: { head: t('gen_msg.create.fail.head', model: model), body: t('gen_msg.create.fail.body') }
261
+ fail: { head: t('gen_msg.create.fail.head', model: model), body: t('gen_msg.create.fail.body', errors: errors) }
259
262
  }[result_or_name]
260
263
  when :update
261
264
  {
262
265
  pass: { head: t('gen_msg.update.pass.head', model: model), body: t('gen_msg.update.pass.body', model: model, name: ename) },
263
- fail: { head: t('gen_msg.update.fail.head', model: model), body: t('gen_msg.update.fail.body') }
266
+ fail: { head: t('gen_msg.update.fail.head', model: model), body: t('gen_msg.update.fail.body', errors: errors) }
264
267
  }[result_or_name]
265
268
  when :destroy
266
269
  { head: t('gen_msg.destroy.head', model: model), body: t('gen_msg.destroy.body', model: model, name: result_or_name) }
@@ -5,6 +5,6 @@
5
5
  ✖
6
6
  <% end %>
7
7
  <strong><%= msg.symbolize_keys[:head] %></strong>
8
- <p><%= msg.symbolize_keys[:body] %></p>
8
+ <p><%= msg.symbolize_keys[:body].gsub /\n/, '<br />' %></p>
9
9
  <% end %>
10
10
  <% end %>
@@ -35,7 +35,7 @@ en:
35
35
  body: "%{model} [%{name}] was successfully created"
36
36
  fail:
37
37
  head: "%{model} creation failed"
38
- body: "Invalid information"
38
+ body: "Invalid information : %{errors}"
39
39
 
40
40
  # Update
41
41
  update:
@@ -1,3 +1,3 @@
1
1
  module CornStarch
2
- VERSION = '1.8.22'
2
+ VERSION = '1.8.23'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: corn_starch
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.22
4
+ version: 1.8.23
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eresse
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-06-23 00:00:00.000000000 Z
11
+ date: 2016-06-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler