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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 54a4cd4285f5c47fe270fbff49fb6b639a69c05bcff645a40508f6a720469148
4
- data.tar.gz: f5514b63f55b49a84e95a439f9c1baacec5798e080cf8f06ab5b9744d2b10b53
3
+ metadata.gz: 1166ce74fdb5aee7a841182f54aa3d1fccfba9e2475781d62fde055880daa38f
4
+ data.tar.gz: 34880a4034f3c9b84aa0eceac8af15b89bd4130107c58c311e44c87537ec203b
5
5
  SHA512:
6
- metadata.gz: 60c173a2b09beeb1af679dc2b15f33a0df489f8da04a656ee4f2decf80366b0907e52a598d4a39ac605171a2d54cb3d84fad7dac7585340f4bf7de60646e6e1d
7
- data.tar.gz: 4a25b83caa173276193da30ba43b4e2f9e68e3bee74b640e8185aea78c1a396b45ac6d1180fc52ebeca4c17a9e617f9c24ba25fb18c1092d5be60d45bb5e4627
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
@@ -1 +1,4 @@
1
1
  require 'coaster/rails_ext/backtrace_cleaner'
2
+ ActiveSupport.on_load(:active_record, yield: true) do
3
+ require 'coaster/rails_ext/active_record/errors'
4
+ end
@@ -1,3 +1,3 @@
1
1
  module Coaster
2
- VERSION = '1.4.17'
2
+ VERSION = '1.4.19'
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.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-18 00:00:00.000000000 Z
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