Sha256: ecbd684aa859a6ca73e4b9a98e33eee4c8853aff7ab00d4f93b35eb10838a1ee

Contents?: true

Size: 387 Bytes

Versions: 63

Compression:

Stored size: 387 Bytes

Contents

module Pulitzer
  class ContentElementType < ActiveRecord::Base
    validates :name, presence: true, uniqueness: true
    has_many :post_type_content_element_types, dependent: :destroy

    def type
      name.downcase.to_sym
    end

    %i(text image video).each do |content_type|
      define_method "#{content_type}_type?" do
        type == content_type
      end
    end
  end
end

Version data entries

63 entries across 63 versions & 1 rubygems

Version Path
pulitzer-0.13.1 app/models/pulitzer/content_element_type.rb
pulitzer-0.12.5 app/models/pulitzer/content_element_type.rb
pulitzer-0.13.0 app/models/pulitzer/content_element_type.rb
pulitzer-0.12.4 app/models/pulitzer/content_element_type.rb
pulitzer-0.12.3 app/models/pulitzer/content_element_type.rb
pulitzer-0.12.2 app/models/pulitzer/content_element_type.rb
pulitzer-0.12.1 app/models/pulitzer/content_element_type.rb
pulitzer-0.12.0 app/models/pulitzer/content_element_type.rb
pulitzer-0.11.3 app/models/pulitzer/content_element_type.rb
pulitzer-0.11.2 app/models/pulitzer/content_element_type.rb
pulitzer-0.11.1 app/models/pulitzer/content_element_type.rb
pulitzer-0.11.0 app/models/pulitzer/content_element_type.rb
pulitzer-0.10.3 app/models/pulitzer/content_element_type.rb
pulitzer-0.10.2 app/models/pulitzer/content_element_type.rb
pulitzer-0.10.1 app/models/pulitzer/content_element_type.rb
pulitzer-0.10.0 app/models/pulitzer/content_element_type.rb
pulitzer-0.5.14 app/models/pulitzer/content_element_type.rb
pulitzer-0.5.13 app/models/pulitzer/content_element_type.rb
pulitzer-0.5.11 app/models/pulitzer/content_element_type.rb
pulitzer-0.5.10 app/models/pulitzer/content_element_type.rb