Class: Releases::Link

Inherits:
ApplicationRecord show all
Defined in:
app/models/releases/link.rb

Constant Summary collapse

FILEPATH_REGEX =
%r{\A/(?:[\-\.\w]+/?)*[\da-zA-Z]+\z}.freeze

Instance Method Summary collapse

Methods inherited from ApplicationRecord

at_most, id_in, id_not_in, iid_in, pluck_primary_key, primary_key_in, safe_ensure_unique, safe_find_or_create_by, safe_find_or_create_by!, underscore, without_order

Instance Method Details

#external?Boolean

Returns:

  • (Boolean)

28
29
30
# File 'app/models/releases/link.rb', line 28

def external?
  !internal?
end

#internal?Boolean

Returns:

  • (Boolean)

24
25
26
# File 'app/models/releases/link.rb', line 24

def internal?
  url.start_with?(release.project.web_url)
end