gitlab-org--gitlab-foss/lib/gitlab/github_import/base_formatter.rb
Robert Speicher 260c8da060 Whitelist or fix additional Gitlab/PublicSend cop violations
An upcoming update to rubocop-gitlab-security added additional
violations.
2017-08-14 12:14:11 -04:00

26 lines
641 B
Ruby

module Gitlab
module GithubImport
class BaseFormatter
attr_reader :client, :formatter, :project, :raw_data
def initialize(project, raw_data, client = nil)
@project = project
@raw_data = raw_data
@client = client
@formatter = Gitlab::ImportFormatter.new
end
def create!
association = project.public_send(project_association) # rubocop:disable GitlabSecurity/PublicSend
association.find_or_create_by!(find_condition) do |record|
record.attributes = attributes
end
end
def url
raw_data.url || ''
end
end
end
end