docbrown/app/models/profile_field_group.rb
2020-09-03 10:12:53 +07:00

9 lines
266 B
Ruby

class ProfileFieldGroup < ApplicationRecord
has_many :profile_fields, dependent: :nullify
validates :name, presence: true, uniqueness: true
scope :onboarding, lambda {
includes(:profile_fields).where(profile_fields: { show_in_onboarding: true })
}
end