Sha256: 755a926aa20c627d5552b9c223a15b9613bcd9b47709dfab2b503e80ca6ab340

Contents?: true

Size: 516 Bytes

Versions: 14

Compression:

Stored size: 516 Bytes

Contents

class PeakFlowUtils::Group < PeakFlowUtils::ApplicationRecord
  attr_writer :at_group

  belongs_to :handler

  has_many :handler_translations, dependent: :destroy
  has_many :translation_keys, dependent: :destroy

  validates :name, :handler, presence: true

  def at_handler
    @at_handler ||= handler.at_handler
  end

  def at_group
    @at_group ||= PeakFlowUtils::GroupService.find_by_handler_and_id(at_handler, identifier) # rubocop:disable Rails/DynamicFindBy
  end

  def to_param
    identifier
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
peak_flow_utils-0.1.19 lib/peak_flow_utils/models/group.rb
peak_flow_utils-0.1.18 lib/peak_flow_utils/models/group.rb
peak_flow_utils-0.1.17 lib/peak_flow_utils/models/group.rb
peak_flow_utils-0.1.16 lib/peak_flow_utils/models/group.rb
peak_flow_utils-0.1.15 lib/peak_flow_utils/models/group.rb
peak_flow_utils-0.1.14 lib/peak_flow_utils/models/group.rb
peak_flow_utils-0.1.13 lib/peak_flow_utils/models/group.rb
peak_flow_utils-0.1.12 lib/peak_flow_utils/models/group.rb
peak_flow_utils-0.1.11 app/models/peak_flow_utils/group.rb
peak_flow_utils-0.1.10 app/models/peak_flow_utils/group.rb
peak_flow_utils-0.1.9 app/models/peak_flow_utils/group.rb
peak_flow_utils-0.1.8 app/models/peak_flow_utils/group.rb
peak_flow_utils-0.1.7 app/models/peak_flow_utils/group.rb
peak_flow_utils-0.1.6 app/models/peak_flow_utils/group.rb