Class: CollavreSlack::SlackCommentLink

Inherits:
ApplicationRecord show all
Defined in:
app/models/collavre_slack/slack_comment_link.rb

Class Method Summary collapse

Class Method Details

.find_by_slack_message(slack_account:, channel_id:, message_ts:) ⇒ Object

Find by Slack channel and message timestamp



12
13
14
15
16
# File 'app/models/collavre_slack/slack_comment_link.rb', line 12

def self.find_by_slack_message(slack_account:, channel_id:, message_ts:)
  joins(:slack_channel_link)
    .where(slack_channel_links: { slack_account_id: .id, channel_id: channel_id })
    .find_by(message_ts: message_ts)
end