coaster 1.4.17 → 1.4.18

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: 54a4cd4285f5c47fe270fbff49fb6b639a69c05bcff645a40508f6a720469148
4
- data.tar.gz: f5514b63f55b49a84e95a439f9c1baacec5798e080cf8f06ab5b9744d2b10b53
3
+ metadata.gz: 2375ede6caac89a8fc38928222a8d1f69e054623183b5dd58c6b7d32a35568e1
4
+ data.tar.gz: '098118e09439e6aa1f70237cd4464691560d443eb9a196a507756d43a58c220c'
5
5
  SHA512:
6
- metadata.gz: 60c173a2b09beeb1af679dc2b15f33a0df489f8da04a656ee4f2decf80366b0907e52a598d4a39ac605171a2d54cb3d84fad7dac7585340f4bf7de60646e6e1d
7
- data.tar.gz: 4a25b83caa173276193da30ba43b4e2f9e68e3bee74b640e8185aea78c1a396b45ac6d1180fc52ebeca4c17a9e617f9c24ba25fb18c1092d5be60d45bb5e4627
6
+ metadata.gz: 39bea4db37ec0d25d6db9693904f16313f357e5c356497e9a1275171c04a722b2eab57c73618618fd65588763b553e7e5900e72d5b9575567b4af5c0d8a82b7e
7
+ data.tar.gz: 5cfc9e5c91546d36721382252b1628bb97ded32882569696eca1435877a0fcc5418df53756c518795922cefc36155fda21db828cc6d4f51ef7607990a9524fb5
@@ -0,0 +1,26 @@
1
+ module ActiveRecord
2
+ module RecordMessages
3
+ # user friendly message, for overid
4
+ def user_message
5
+ return _translate if description.present? || tkey.present?
6
+ return record.errors.full_messages.join(', ') if record.present?
7
+ return "#{_translate} (#{user_digests})" unless defined?(@coaster)
8
+ message
9
+ rescue => e
10
+ "#{message} (user_message_error - #{e.class.name} #{e.message})"
11
+ end
12
+ end
13
+
14
+ class RecordNotSaved < ActiveRecordError
15
+ include RecordMessages
16
+ end
17
+ class RecordNotDestroyed < ActiveRecordError
18
+ include RecordMessages
19
+ end
20
+ class SoleRecordExceeded < ActiveRecordError
21
+ include RecordMessages
22
+ end
23
+ class StaleObjectError < ActiveRecordError
24
+ include RecordMessages
25
+ end
26
+ end
@@ -1 +1,2 @@
1
1
  require 'coaster/rails_ext/backtrace_cleaner'
2
+ require 'coaster/rails_ext/active_record/errors'
@@ -1,3 +1,3 @@
1
1
  module Coaster
2
- VERSION = '1.4.17'
2
+ VERSION = '1.4.18'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coaster
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.17
4
+ version: 1.4.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - buzz jung
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-11-18 00:00:00.000000000 Z
11
+ date: 2024-12-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: oj
@@ -206,6 +206,7 @@ files:
206
206
  - lib/coaster/git/options.rb
207
207
  - lib/coaster/git/repository.rb
208
208
  - lib/coaster/rails_ext.rb
209
+ - lib/coaster/rails_ext/active_record/errors.rb
209
210
  - lib/coaster/rails_ext/backtrace_cleaner.rb
210
211
  - lib/coaster/safe_yaml_serializer.rb
211
212
  - lib/coaster/serialized_properties.rb