corn_starch 1.9.33 → 1.9.34

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: 0c4cb1360eb3e3b64083e85a833bb8d2ec2951e0
4
- data.tar.gz: e89dc2253edac2293056e52eb95e56c134801ace
3
+ metadata.gz: 8aaa293c4d5ab907eac1271668003a376d99c58c
4
+ data.tar.gz: 55343a0f12c2df0430ded42918cdba1206804c59
5
5
  SHA512:
6
- metadata.gz: 11d0fe1f8e5ea51afdbd0fb4d77b1e66284ec20c5cbb50edab7e9acbc64b92072e5ca8bddff8fe471e942dc1ac4afdfe386411234b21165b7c37517ae1bca555
7
- data.tar.gz: b01c634b313dcbc289042349da9510c144650044046e0bece71a0cebe76a35c8071e5c02e5fcbe26332c50676e9d88252eb5ab9ccdb8ce5601b8b6bb752b46f5
6
+ metadata.gz: 123290fe02a36801e17799030b0a102cadb5e8bad64ae78b01be4feb77bccbf8f93d0100f01533378275434706683e38730b1252481eb93cc1cb89c9c8e1509d
7
+ data.tar.gz: 9efce69c28ebaa7e1ecd8a6c46ff20a4b67412b965d62d845538df651f7b558e34047649f32bafa3894bc85706e2fa6aa8c579f695ebe32672bade205244bfb9
@@ -240,19 +240,14 @@ module CornStarch
240
240
  ename = entity ? entity.display_name : ''
241
241
 
242
242
  # Acquire Errors
243
- errors = entity.try(:errors).try(:full_messages).try(:collect) { |e| "\n - #{e}" }.try :join
243
+ errors = notify_errors entity
244
244
 
245
245
  # Switch on Action
246
246
  case action
247
247
 
248
248
  # Session Control
249
- when :login
250
- {
251
- pass: { head: t('gen_msg.login.pass.head'), body: t('gen_msg.login.pass.body', name: uname) },
252
- fail: { head: t('gen_msg.login.fail.head'), body: t('gen_msg.login.fail.body') }
253
- }[result_or_name]
254
- when :logout
255
- { head: t('gen_msg.logout.head'), body: t('gen_msg.logout.body') }
249
+ when :login then notify_res 'gen_msg.login', result_or_name, name: uname
250
+ when :logout then notify 'gen_msg.logout'
256
251
 
257
252
  # Generic Resources
258
253
  when :create
@@ -283,5 +278,10 @@ module CornStarch
283
278
  def notify key, head_hash = nil, body_hash = nil
284
279
  { head: t("#{key}.head", head_hash), body: t("#{key}.body", body_hash) }
285
280
  end
281
+
282
+ # Build Pass / Fail Notification
283
+ def notify_res key, res, head_hash = nil, body_hash = nil
284
+ Hash[[:pass, :fail].map { |r| notify "#{key}.#{r}", head_hash, body_hash }][res]
285
+ end
286
286
  end
287
287
  end
@@ -1,3 +1,3 @@
1
1
  module CornStarch
2
- VERSION = '1.9.33'
2
+ VERSION = '1.9.34'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: corn_starch
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.33
4
+ version: 1.9.34
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eresse