Use try instead of respond_to?

parent f6c44478
...@@ -26,9 +26,7 @@ module Geo ...@@ -26,9 +26,7 @@ module Geo
end end
def project_id def project_id
return nil unless event.respond_to?(:project_id) event.try(:project_id)
event.project_id
end end
end end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment