Sha256: e7f2cbb5f4837578562061c4d2acdd0868d2d086ea657664aaf1b4b63b7c7004
Contents?: true
Size: 765 Bytes
Versions: 10
Compression:
Stored size: 765 Bytes
Contents
# frozen_string_literal: true module Sail # Entry # # The Entry class holds the saved value # for settings for each profile. It is # a model for representing the N x N # relationship between profiles and settings class Entry < ApplicationRecord belongs_to :setting belongs_to :profile validates :value, :setting, :profile, presence: true scope :by_profile_name, ->(name) { joins(:profile).where("sail_profiles.name = ?", name) } delegate :name, to: :setting # dirty? # # dirty? will return true if # the entry value is different # than the associated setting value. # This happens when a setting is changed # without saving the profile. def dirty? value != setting.value end end end
Version data entries
10 entries across 10 versions & 1 rubygems