File tree Expand file tree Collapse file tree
lib/public_activity/orm/active_record Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -24,19 +24,20 @@ class Activity < ::ActiveRecord::Base
2424 self . table_name = PublicActivity . config . table_name
2525 self . abstract_class = true
2626
27- # Define polymorphic association to the parent
28- belongs_to :trackable , polymorphic : true
29-
3027 case ::ActiveRecord ::VERSION ::MAJOR
3128 when 5
3229 with_options ( required : false ) do
30+ # Define polymorphic association to the parent
31+ belongs_to :trackable , polymorphic : true
3332 # Define ownership to a resource responsible for this activity
3433 belongs_to :owner , polymorphic : true
3534 # Define ownership to a resource targeted by this activity
3635 belongs_to :recipient , polymorphic : true
3736 end
3837 when 6 ..7
3938 with_options ( optional : true ) do
39+ # Define polymorphic association to the parent
40+ belongs_to :trackable , polymorphic : true
4041 # Define ownership to a resource responsible for this activity
4142 belongs_to :owner , polymorphic : true
4243 # Define ownership to a resource targeted by this activity
You can’t perform that action at this time.
0 commit comments