Sha256: b5fb253dc285fcb05fb2e6b19f1adf68c7341234c6c753f3a59692ff673cf533
Contents?: true
Size: 1.11 KB
Versions: 1
Compression:
Stored size: 1.11 KB
Contents
module AxleAttributes class Definition module Customization extend ActiveSupport::Concern included do class_attribute :cached_customizations self.cached_customizations = {} end module ClassMethods def cached_customization_for(namespace) cached_customizations[namespace] ||= AttributeCustomization.namespace_cache_for(namespace).read end end def customization self.class.cached_customization_for(namespace)[name] end def display_name read_customization(:display_name) || name.titlecase.gsub('.', ' ') end def description read_customization :description end def notes read_customization :notes end def editable_customization value = customization.try(:editable) value.nil? ? true : value end def deprecated_on read_customization :deprecated_on end def deprecated? deprecated_on.present? end def read_customization(property) customization.try(property).presence end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
axle_attributes-1.13.2 | lib/axle_attributes/definition/customization.rb |