public_activity 1.4.2 → 1.4.3

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
  SHA1:
3
- metadata.gz: 6103bac0cace649e4ff37f4532b180c928ea40ad
4
- data.tar.gz: 88f9f4141aead30d2cb486f87a3aea85180a81f3
3
+ metadata.gz: 133186d2fb5149e6b12c499d588cafb173fa840c
4
+ data.tar.gz: 9dfa82ab740c143daa9d3c833bc15d2c7efd4604
5
5
  SHA512:
6
- metadata.gz: 6d56975f27da92972716721fcaaca43a5425eca1a2388785f2eb5e8f5ae43fe8135858bc74c5b0b9be0b0a46ecb83da4bb550fed87dd2f925661d73258228e69
7
- data.tar.gz: b809c0267587d603f5e54435bbacb9c81bb715caae7f993bc0ff39c1d59500427b75b434adcfc02752a8beac5344fee69f52714a09f1b0072c460bed2ecd8048
6
+ metadata.gz: dada05aea04f8bc8f20e9d474317bffff945d38da725c579feb960498bb7c12990ffd81d58b58448c177a7b20f1ac289b294cd5ef322c499ab9b09e5b8db4532
7
+ data.tar.gz: b0d35c25b9f8834fbb6f0fa9f6b3cde6936e3fdeba387b8c3eb2c595fc0ae886dce19e786a862588f2f3008117f75c0044dbdef17055b9d9dc088f12f2e5c043
@@ -9,10 +9,12 @@ module PublicActivity
9
9
 
10
10
  # Define polymorphic association to the parent
11
11
  belongs_to :trackable, :polymorphic => true
12
- # Define ownership to a resource responsible for this activity
13
- belongs_to :owner, :polymorphic => true
14
- # Define ownership to a resource targeted by this activity
15
- belongs_to :recipient, :polymorphic => true
12
+ with_options(::ActiveRecord::VERSION::MAJOR >= 5 ? { :required => false } : { }) do
13
+ # Define ownership to a resource responsible for this activity
14
+ belongs_to :owner, :polymorphic => true
15
+ # Define ownership to a resource targeted by this activity
16
+ belongs_to :recipient, :polymorphic => true
17
+ end
16
18
  # Serialize parameters Hash
17
19
  serialize :parameters, Hash
18
20
 
@@ -26,7 +26,12 @@ module PublicActivity
26
26
  extend ActiveSupport::Concern
27
27
 
28
28
  included do
29
- before_filter :store_controller_for_public_activity
29
+ # use :before_action instead of deprecated before_filter
30
+ if respond_to? :before_action
31
+ before_action :store_controller_for_public_activity
32
+ else
33
+ before_filter :store_controller_for_public_activity
34
+ end
30
35
  end
31
36
 
32
37
  # Before filter executed to remember current controller
@@ -1,4 +1,4 @@
1
1
  module PublicActivity
2
2
  # A constant with gem's version
3
- VERSION = '1.4.2'
3
+ VERSION = '1.4.3'
4
4
  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: 1.4.2
4
+ version: 1.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Piotrek Okoński
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-08-19 00:00:00.000000000 Z
12
+ date: 2016-02-18 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: actionpack
@@ -255,7 +255,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
255
255
  version: '0'
256
256
  requirements: []
257
257
  rubyforge_project:
258
- rubygems_version: 2.2.2
258
+ rubygems_version: 2.4.8
259
259
  signing_key:
260
260
  specification_version: 4
261
261
  summary: Easy activity tracking for ActiveRecord models