Sha256: eb6fc2bb40e79221cb36bd32868900c54a2a1457874f78a89cd7117d27fa1420

Contents?: true

Size: 454 Bytes

Versions: 11

Compression:

Stored size: 454 Bytes

Contents

Houston::Slack.config do
  overhear(/\b(?<task>\d+[a-z]+)\b/) do |e|
    next unless e.user
    tasks = Task.joins(:ticket)

    if project = e.channel.name != "test" && Project.find_by_slug(e.channel.name)
      tasks = tasks.where(Ticket.arel_table[:project_id].eq(project.id))
    else
      tasks = tasks.merge(Ticket.open)
    end

    tasks.with_shorthand(e.match[:task]).each do |task|
      e.unfurl slack_task_attachment(task)
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
houston-core-0.9.2 templates/new-instance/config/conversations/mentions/unfurl_tasks.rb
houston-core-0.9.1 templates/new-instance/config/conversations/mentions/unfurl_tasks.rb
houston-core-0.9.0 templates/new-instance/config/conversations/mentions/unfurl_tasks.rb
houston-core-0.9.0.rc1 templates/new-instance/config/conversations/mentions/unfurl_tasks.rb
houston-core-0.8.4 templates/new-instance/config/conversations/mentions/unfurl_tasks.rb
houston-core-0.8.3 templates/new-instance/config/conversations/mentions/unfurl_tasks.rb
houston-core-0.8.2 templates/new-instance/config/conversations/mentions/unfurl_tasks.rb
houston-core-0.8.1 templates/new-instance/config/conversations/mentions/unfurl_tasks.rb
houston-core-0.8.0 templates/new-instance/config/conversations/mentions/unfurl_tasks.rb
houston-core-0.8.0.pre2 templates/new-instance/config/conversations/mentions/unfurl_tasks.rb
houston-core-0.8.0.pre templates/new-instance/config/conversations/mentions/unfurl_tasks.rb