Sha256: 469c9000fa0dcce501d4f6f616dbb90afc7396f896686cc4d53034a1b56ff87b
Contents?: true
Size: 910 Bytes
Versions: 14
Compression:
Stored size: 910 Bytes
Contents
module Shipit class GithubHook < ActiveRecord::Base # TODO: app-migration, delete class belongs_to :stack, required: false # Required for fixtures before_destroy :teardown! delegate :github_repo_name, to: :stack def teardown! destroy_hook! if already_setup? true end def event=(event) super(event.to_s) end def already_setup? github_id? end def api Shipit.legacy_github_api end class Repo < GithubHook belongs_to :stack, required: true private def destroy_hook! api.remove_hook(github_repo_name, github_id) rescue Octokit::NotFound end end class Organization < GithubHook validates :organization, presence: true private def destroy_hook! api.remove_org_hook(organization, github_id) rescue Octokit::NotFound end end end end
Version data entries
14 entries across 14 versions & 1 rubygems