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 +4 -4
- data/lib/coaster/rails_ext/active_record/errors.rb +26 -0
- data/lib/coaster/rails_ext.rb +1 -0
- data/lib/coaster/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2375ede6caac89a8fc38928222a8d1f69e054623183b5dd58c6b7d32a35568e1
|
4
|
+
data.tar.gz: '098118e09439e6aa1f70237cd4464691560d443eb9a196a507756d43a58c220c'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
data/lib/coaster/rails_ext.rb
CHANGED
data/lib/coaster/version.rb
CHANGED
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.
|
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
|
+
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
|