coaster 1.3.22 → 1.3.24

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: f3581252e85de72f2bb67b3f78ad8927a2b565ee3b7d0565fa4185f0776a1a8f
4
- data.tar.gz: 938d2b55bbf20d4e3a515091e1221990d10dc37c6745febd7f1b7fdadc9c9e2f
3
+ metadata.gz: 93d6eff77edc91b0d5989d307825945689cfc919db3bd239b4f78f1618613efe
4
+ data.tar.gz: 427785528213c55a795202ccc1ce8f0022df964049d5c6ac19a7e3ada026addc
5
5
  SHA512:
6
- metadata.gz: ed14c09e48a6ee1e1ef6b590efd7b42d98ea8e61b24060ee2ee7548b79f18fff93d086bba800d3d9b54a9d4689730bf3716ebbf1276572b1b13db0e158c7de98
7
- data.tar.gz: 13ec823f5b9d0c0183a85ca93d1343737955bb7a3cfbbd053ee5b5bd5831212becf310953ffa2edb19349db6747d1082c52a5f9c4db6809e0fee2c212122aa20
6
+ metadata.gz: 8c679ef541736287ab90c0ae9cba765c3df13ee4713371bc124b36bd35e9bf48b4ed98e08dae42a1850be4f0c7d6f42e805e7062ccc0b927707ad7ff2d0910e6
7
+ data.tar.gz: cd12e7dadf13ffb039c75674d82868cc9a61f086fb1f55a1bdd73a02002895eb68107359a557d7d18d343a8f768a2cd8773956f2e00c5e811a2853695cc6a605
@@ -278,7 +278,7 @@ class StandardError
278
278
  dh = _dh || to_inspection_hash(options: options, _h: {}.with_indifferent_access, _depth: 0)
279
279
  lg = "[#{dh[:type]}] status:#{dh[:status]}"
280
280
  lg += "\n MESSAGE: #{dh[:message]&.gsub(/\n/, "\n ")}"
281
- dh[:instance_variables].each do |var, val|
281
+ dh[:instance_variables]&.each do |var, val|
282
282
  lg += "\n #{var}: #{val}"
283
283
  end
284
284
  if (bt = dh[:backtrace] || [])
@@ -73,7 +73,8 @@ module Coaster
73
73
  },
74
74
  getter: proc { |val|
75
75
  type.include?(val) ? val : nil
76
- }
76
+ },
77
+ default: default
77
78
  else
78
79
  if type == Time
79
80
  _define_serialized_property serialize_column, key,
@@ -82,18 +83,20 @@ module Coaster
82
83
  if val.is_a?(Time)
83
84
  val.respond_to?(:to_fs) ? val.to_fs(:default_tz) : val.to_s(:default_tz)
84
85
  end
85
- }
86
+ },
87
+ default: default
86
88
  elsif type == Integer
87
89
  _define_serialized_property serialize_column, key,
88
90
  setter: proc { |val|
89
91
  val = val.blank? ? nil : Integer(val)
90
92
  val = setter.call(val) if setter
91
93
  val
92
- }
94
+ },
95
+ default: default
93
96
  elsif type == Array
94
- _define_serialized_property(serialize_column, key, default: [])
97
+ _define_serialized_property(serialize_column, key, default: default || [])
95
98
  elsif type && type < ActiveRecord::Base
96
- _define_serialized_property serialize_column, "#{key}_id"
99
+ _define_serialized_property serialize_column, "#{key}_id", default: default
97
100
 
98
101
  define_method key.to_sym do
99
102
  instance_val = instance_variable_get("@#{key}".to_sym)
@@ -1,3 +1,3 @@
1
1
  module Coaster
2
- VERSION = '1.3.22'
2
+ VERSION = '1.3.24'
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.3.22
4
+ version: 1.3.24
5
5
  platform: ruby
6
6
  authors:
7
7
  - buzz jung
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-12-21 00:00:00.000000000 Z
11
+ date: 2022-12-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: i18n