Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed #notifiable_path #45

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions lib/activity_notification/models/concerns/notifiable.rb
Original file line number Diff line number Diff line change
Expand Up @@ -165,12 +165,16 @@ def notifiable_path(target_type, key = nil)
nil,
key)
unless resolved_parameter
begin
resolved_parameter = polymorphic_path(self)
rescue NoMethodError, ActionController::UrlGenerationError
raise NotImplementedError, "You have to implement #{self.class}##{__method__}, "\
if defined?(super)
resolved_parameter = super
else
begin
resolved_parameter = defined?(super) ? super : polymorphic_path(self)
rescue NoMethodError, ActionController::UrlGenerationError
raise NotImplementedError, "You have to implement #{self.class}##{__method__}, "\
"set :notifiable_path in acts_as_notifiable or "\
"set polymorphic_path routing for #{self.class}"
end
end
end
resolved_parameter
Expand Down Expand Up @@ -398,4 +402,4 @@ def cast_to_resources_sym(target_type)
target_type.to_s.to_resources_name.to_sym
end
end
end
end