Skip to content
This repository was archived by the owner on Jun 20, 2025. It is now read-only.

Add migration to Intercom - #1

Open
ulizko wants to merge 3 commits into
mkdev-me:masterfrom
ulizko:migrate-ticket-to-intercom
Open

ulizko wants to merge 3 commits into
mkdev-me:masterfrom
ulizko:migrate-ticket-to-intercom

Conversation

@ulizko

@ulizko ulizko commented Sep 6, 2017

Copy link
Copy Markdown

No description provided.

Comment thread apps/web/config/routes.rb Outdated

get '/', to: 'folders#index'

post '/tickets/:id/export', to: 'tickets#export', as: :export_ticket

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are rails-like resource routes http://hanamirb.org/guides/routing/restful-resources/

ticket = TicketRepository.new.find(params[:id])
ticket.migrate
redirect_to '/'
end

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some notification like "Exported started" would be great

Comment thread lib/mkdev_hanami/entities/ticket.rb Outdated

def messages
MessageRepository.new.by_ticket(id)
end

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like associations. There is support of assoications in Hanami: http://hanamirb.org/guides/1.0/models/associations/

Comment thread Gemfile Outdated
gem 'warden'
gem 'groovehq'
gem 'intercom'
gem 'sucker_punch', '~> 2.0'

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's wrong with Sidekiq?

Comment thread lib/mkdev_hanami/services/intercom.rb Outdated
require 'intercom'

module Services
class Intercom

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it recommended way to implement service objects? Ain't Hanami Entities better choice?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants