Sha256: 04aa008fda8b259909a3500c0187ca2e10b57b36228e4e067e041eefbc7c5790
Contents?: true
Size: 502 Bytes
Versions: 18
Compression:
Stored size: 502 Bytes
Contents
module Pulitzer class ContentElementType < ActiveRecord::Base validates :name, presence: true, uniqueness: true has_many :post_type_content_element_types, dependent: :destroy has_many :layouts, dependent: :destroy def type name.downcase.to_sym end %i(text image video clickable).each do |content_type| define_method "#{content_type}_type?" do type == content_type end end def has_styles? [:clickable].include? type end end end
Version data entries
18 entries across 18 versions & 1 rubygems