Sha256: 8bbb4740ce53d396910cb060273e525f8312a9cb1be6cb81a9262a40d8688493

Contents?: true

Size: 475 Bytes

Versions: 15

Compression:

Stored size: 475 Bytes

Contents

Houston::Slack.config do
  overhear(/\b(?<task>\d+[a-z]+)\b/) do |e|
    next unless e.user && e.user.developer?
    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

15 entries across 15 versions & 1 rubygems

Version Path
houston-core-0.7.0 templates/new-instance/config/conversations/mentions/unfurl_tasks.rb
houston-core-0.7.0.beta4 templates/new-instance/config/conversations/mentions/unfurl_tasks.rb
houston-core-0.7.0.beta3 templates/new-instance/config/conversations/mentions/unfurl_tasks.rb
houston-core-0.7.0.beta2 templates/new-instance/config/conversations/mentions/unfurl_tasks.rb
houston-core-0.7.0.beta templates/new-instance/config/conversations/mentions/unfurl_tasks.rb
houston-core-0.6.3 templates/new-instance/config/conversations/mentions/unfurl_tasks.rb
houston-core-0.6.2 templates/new-instance/config/conversations/mentions/unfurl_tasks.rb
houston-core-0.6.1 templates/new-instance/config/conversations/mentions/unfurl_tasks.rb
houston-core-0.6.0 templates/new-instance/config/conversations/mentions/unfurl_tasks.rb
houston-core-0.5.6 templates/new-instance/config/conversations/mentions/unfurl_tasks.rb
houston-core-0.5.5 templates/new-instance/config/conversations/mentions/unfurl_tasks.rb
houston-core-0.5.4 templates/new-instance/config/conversations/mentions/unfurl_tasks.rb
houston-core-0.5.3 templates/new-instance/config/conversations/mentions/unfurl_tasks.rb
houston-core-0.5.2 templates/new-instance/config/conversations/mentions/unfurl_tasks.rb
houston-core-0.5.1 templates/new-instance/config/conversations/mentions/unfurl_tasks.rb