5819ca1a24
One should really use a separate table instead of using polymorphic associations. See https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/11168 for more information.
9 lines
258 B
Ruby
9 lines
258 B
Ruby
class UserAgentDetail < ActiveRecord::Base
|
|
belongs_to :subject, polymorphic: true # rubocop:disable Cop/PolymorphicAssociations
|
|
|
|
validates :user_agent, :ip_address, :subject_id, :subject_type, presence: true
|
|
|
|
def submittable?
|
|
!submitted?
|
|
end
|
|
end
|