DEV: Prefer public_send over send.

This commit is contained in:
Guo Xiang Tan
2019-05-07 09:27:05 +08:00
parent 9be70a22cd
commit 152238b4cf
74 changed files with 216 additions and 129 deletions

View File

@ -48,7 +48,13 @@ module DiscourseNarrativeBot
begin
old_data = @data.dup
new_post = (@skip && @state != :end) ? skip_tutorial(next_state) : self.send(action)
new_post =
if (@skip && @state != :end)
skip_tutorial(next_state)
else
self.public_send(action)
end
if new_post
old_state = old_data[:state]

View File

@ -532,7 +532,10 @@ module DiscourseNarrativeBot
end
def url_helpers(url, opts = {})
Rails.application.routes.url_helpers.send(url, opts.merge(host: Discourse.base_url))
Rails.application.routes.url_helpers.public_send(
url,
opts.merge(host: Discourse.base_url)
)
end
end
end