Code Duplication    Length = 15-16 lines in 4 locations

app/models/survey_participant.rb 1 location

@@ 13-28 (lines=16) @@
10
11
  validates_uniqueness_of :survey, scope: :participant
12
  validates_uniqueness_of :participant, scope: :survey
13
  
14
  def to_s
15
    "#{participant} #{survey}"
16
  end
17
end
18
19
# == Schema Information
20
#
21
# Table name: survey_participants
22
#
23
#  id             :integer          not null, primary key
24
#  participant_id :integer          not null
25
#  survey_id      :integer          not null
26
#  created_at     :datetime         not null
27
#  updated_at     :datetime         not null
28
#
29
# Indexes
30
#
31
#  index_by_participant_survey                  (participant_id,survey_id) UNIQUE

app/models/study_event_instrument.rb 1 location

@@ 12-27 (lines=16) @@
9
  validates :instrument, presence: true
10
11
  validates_uniqueness_of :instrument, scope: :study_event
12
  validates_uniqueness_of :study_event, scope: :instrument
13
  
14
  def to_s
15
    "#{study_event} #{instrument}"
16
  end
17
end
18
19
# == Schema Information
20
#
21
# Table name: study_event_instruments
22
#
23
#  id             :integer          not null, primary key
24
#  study_event_id :integer          not null
25
#  instrument_id  :integer          not null
26
#  created_at     :datetime         not null
27
#  updated_at     :datetime         not null
28
#
29
# Indexes
30
#

app/models/assessment_instrument.rb 1 location

@@ 12-27 (lines=16) @@
9
  validates :instrument, presence: true
10
11
  validates_uniqueness_of :instrument, scope: :assessment
12
  validates_uniqueness_of :assessment, scope: :instrument
13
  
14
  def to_s
15
    "#{assessment} #{instrument}"
16
  end
17
end
18
19
# == Schema Information
20
#
21
# Table name: assessment_instruments
22
#
23
#  id            :integer          not null, primary key
24
#  assessment_id :integer          not null
25
#  instrument_id :integer          not null
26
#  created_at    :datetime         not null
27
#  updated_at    :datetime         not null
28
#
29
# Indexes
30
#

app/models/study_participant.rb 1 location

@@ 13-27 (lines=15) @@
10
  validates_uniqueness_of :study, scope: :participant
11
  validates_uniqueness_of :participant, scope: :study
12
  
13
  def to_s
14
    "#{participant} #{study}"
15
  end
16
end
17
18
# == Schema Information
19
#
20
# Table name: study_participants
21
#
22
#  id             :integer          not null, primary key
23
#  participant_id :integer          not null
24
#  study_id       :integer          not null
25
#  subject_number :string        
26
#  created_at     :datetime         not null
27
#  updated_at     :datetime         not null
28
#
29
# Indexes
30
#