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

Fixes #22205 - restore blueprint actions for notifications #5159

Merged
merged 1 commit into from
Jan 16, 2018
Merged
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
4 changes: 2 additions & 2 deletions app/models/notification.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,10 @@ def set_notification_recipients

def set_custom_attributes
return unless notification_blueprint # let validation catch this.
self.actions ||= UINotifications::URLResolver.new(
self.actions = UINotifications::URLResolver.new(
subject,
notification_blueprint.actions
).actions if notification_blueprint.actions.any?
).actions if notification_blueprint.actions.any? && self.actions.blank?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a ruby developer, but multi line statements with guards are hard to parse for me.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not making the problem worse, since this will be cherrypicked I'd probably keep it as it is, I can open separate PR with refactoring if you prefer

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#5170 addresses it

# copy notification message in case we didn't create a custom one.
self.message ||= UINotifications::StringParser.new(
notification_blueprint.message,
Expand Down