coaster 1.4.17 → 1.4.19
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 +3 -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: 1166ce74fdb5aee7a841182f54aa3d1fccfba9e2475781d62fde055880daa38f
|
4
|
+
data.tar.gz: 34880a4034f3c9b84aa0eceac8af15b89bd4130107c58c311e44c87537ec203b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8516ef3644c4eac784bc6994b677c7ccd0cd2ffc3bb4f0c7e51ce7712ea83cfbc40f6de7a1e1c11278c71d1512ace509ce3ebd6081873f137d62d14874fe49f5
|
7
|
+
data.tar.gz: 140440f93d3bc1bd3800d081cead6a5d5ecb9b51839866da80f62ab66ac2dc39f48b15fd192b80f00e3966ee0820e3dca43b55591aa8e2079bd8b3811a88cd24
|
@@ -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.19
|
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-10 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
|