public_activity 3.0.0 → 3.0.1

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: 205982c0ffd6df075bb62cb449f9122e16e05bdb12df2035fb1ba5e4bd851407
4
- data.tar.gz: dc80f1bc7388e6c6daf82089ca451aa427b73ad527259d1c454edc6275f53813
3
+ metadata.gz: 37a2aa6ff87085d7785379491f35a7ff8a72b7683817ba06606f5c96e641985d
4
+ data.tar.gz: 628131cc96ae6dc8c871e8ef0a480331f635fddafcd4f162e18dedf9aa89d25d
5
5
  SHA512:
6
- metadata.gz: 349041c271065c68564cc3844ad69f1f1e09a43bc4056d3c151f3dbca73340bf5d3d8de5ab665a8c9b62178531f6172af339214fd5dfbbe2c8cdee57a12b8231
7
- data.tar.gz: 87362737e5d74dcb448fb5cfd524e01b57e2176c63600b8aa170e5f6b1a114c8754d0fcb46fe94ef23694a89994f799a814184fb064b630a3c80a72165789b78
6
+ metadata.gz: 14419c7a77acd1d7332a1ccde54aa6a563b22b2898e1d8e62c6d569240ed7b3b09adfb36388e35115987f872cb17ad9c78c5723a2f77307527e670c0beea05bd
7
+ data.tar.gz: 6b020d2ad93e424b727c10565b6b38c0d1073f4e5c79bd8c1162827c11a23b1424160b6de728af27dc03ca2e42186385bf5df5b6fcf802c581567f42d4f2aecf
@@ -19,15 +19,16 @@ module PublicActivity
19
19
  # end
20
20
  #
21
21
  # In controller:
22
- # User.first.activities
22
+ # User.first.activities_as_owner
23
+ # User.first.activities_as_recipient
23
24
  #
24
25
  def activist
25
26
  has_many :activities_as_owner,
26
- :class_name => "::PublicActivity::Activity",
27
- :as => :owner
27
+ class_name: '::PublicActivity::Activity',
28
+ as: :owner
28
29
  has_many :activities_as_recipient,
29
- :class_name => "::PublicActivity::Activity",
30
- :as => :recipient
30
+ class_name: '::PublicActivity::Activity',
31
+ as: :recipient
31
32
  end
32
33
  end
33
34
  end
@@ -36,7 +36,13 @@ module PublicActivity
36
36
  # Serialize parameters Hash
37
37
  begin
38
38
  if table_exists?
39
- serialize :parameters, coder: YAML, type: Hash unless %i[json jsonb hstore].include?(columns_hash['parameters'].type)
39
+ unless %i[json jsonb hstore].include?(columns_hash['parameters'].type)
40
+ if ::ActiveRecord.version.release < Gem::Version.new('7.1')
41
+ serialize :parameters, Hash
42
+ else
43
+ serialize :parameters, coder: YAML, type: Hash
44
+ end
45
+ end
40
46
  else
41
47
  warn("[WARN] table #{name} doesn't exist. Skipping PublicActivity::Activity#parameters's serialization")
42
48
  end
@@ -9,7 +9,9 @@ module PublicActivity
9
9
  # Creates an association for activities where self is the *trackable*
10
10
  # object.
11
11
  def self.extended(base)
12
- base.has_many :activities, :class_name => "::PublicActivity::Activity", :as => :trackable
12
+ base.has_many :activities,
13
+ class_name: '::PublicActivity::Activity',
14
+ as: :trackable
13
15
  end
14
16
  end
15
17
  end
@@ -2,5 +2,5 @@
2
2
 
3
3
  module PublicActivity
4
4
  # A constant with gem's version
5
- VERSION = '3.0.0'
5
+ VERSION = '3.0.1'
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: public_activity
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0
4
+ version: 3.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juri Hahn
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2024-01-20 00:00:00.000000000 Z
13
+ date: 2024-02-14 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: actionpack
@@ -288,7 +288,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
288
288
  - !ruby/object:Gem::Version
289
289
  version: '0'
290
290
  requirements: []
291
- rubygems_version: 3.5.5
291
+ rubygems_version: 3.5.6
292
292
  signing_key:
293
293
  specification_version: 4
294
294
  summary: Easy activity tracking for ActiveRecord models