File tree 3 files changed +14
-11
lines changed
3 files changed +14
-11
lines changed Original file line number Diff line number Diff line change 1
1
### Unreleased
2
2
3
+ * Set ` :json ` type on ` :params ` column with default to better integrate with ActiveRecord.
4
+ This fixes sqlserver (and probably other databases). #451
5
+
3
6
### 2.3.1
4
7
5
8
* Skip ` ApplicationNotifier ` in generator if it already exists
Original file line number Diff line number Diff line change @@ -6,17 +6,6 @@ module Deliverable
6
6
class_attribute :bulk_delivery_methods , instance_writer : false , default : { }
7
7
class_attribute :delivery_methods , instance_writer : false , default : { }
8
8
class_attribute :required_param_names , instance_writer : false , default : [ ]
9
-
10
- attribute :params , default : { }
11
-
12
- # Ephemeral notifiers cannot serialize params since they aren't ActiveRecord backed
13
- if respond_to? :serialize
14
- if Rails . gem_version >= Gem ::Version . new ( "7.1.0.alpha" )
15
- serialize :params , coder : Coder
16
- else
17
- serialize :params , Coder
18
- end
19
- end
20
9
end
21
10
22
11
class_methods do
Original file line number Diff line number Diff line change @@ -11,5 +11,16 @@ class Event < ApplicationRecord
11
11
accepts_nested_attributes_for :notifications
12
12
13
13
scope :newest_first , -> { order ( created_at : :desc ) }
14
+
15
+ attribute :params , :json , default : { }
16
+
17
+ # Ephemeral notifiers cannot serialize params since they aren't ActiveRecord backed
18
+ if respond_to? :serialize
19
+ if Rails . gem_version >= Gem ::Version . new ( "7.1.0.alpha" )
20
+ serialize :params , coder : Coder
21
+ else
22
+ serialize :params , Coder
23
+ end
24
+ end
14
25
end
15
26
end
You can’t perform that action at this time.
0 commit comments