Sha256: 0a3ea418a1a9e47e3fd42ba3fca4581df169fc0057ab43658f327c099bc90279

Contents?: true

Size: 718 Bytes

Versions: 5

Compression:

Stored size: 718 Bytes

Contents

# frozen_string_literal: true
module SocialNetworking
  # A question that is posed to participants when a profile is being created or
  # updated.
  class ProfileAnswer < ActiveRecord::Base
    belongs_to :profile,
               class_name: "SocialNetworking::Profile",
               foreign_key: :social_networking_profile_id
    belongs_to :profile_question,
               class_name: "SocialNetworking::ProfileQuestion",
               foreign_key: :social_networking_profile_question_id

    validates :profile, :profile_question, presence: true
    validates :social_networking_profile_question_id, uniqueness: {
      scope: :social_networking_profile_id, message: "has already been answered"
    }
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
social_networking-0.13.3 app/models/social_networking/profile_answer.rb
social_networking-0.13.2 app/models/social_networking/profile_answer.rb
social_networking-0.13.1 app/models/social_networking/profile_answer.rb
social_networking-0.13.0 app/models/social_networking/profile_answer.rb
social_networking-0.12.0 app/models/social_networking/profile_answer.rb