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.4.6 app/models/pulitzer/content_element_type.rb
pulitzer-0.4.5 app/models/pulitzer/content_element_type.rb
pulitzer-0.4.4 app/models/pulitzer/content_element_type.rb
pulitzer-0.4.3 app/models/pulitzer/content_element_type.rb
pulitzer-0.4.2 app/models/pulitzer/content_element_type.rb
pulitzer-0.4.1 app/models/pulitzer/content_element_type.rb
pulitzer-0.4.0 app/models/pulitzer/content_element_type.rb
pulitzer-0.3.9 app/models/pulitzer/content_element_type.rb
pulitzer-0.3.8 app/models/pulitzer/content_element_type.rb
pulitzer-0.3.7 app/models/pulitzer/content_element_type.rb
pulitzer-0.3.6 app/models/pulitzer/content_element_type.rb
pulitzer-0.3.5 app/models/pulitzer/content_element_type.rb
pulitzer-0.3.4 app/models/pulitzer/content_element_type.rb
pulitzer-0.3.3 app/models/pulitzer/content_element_type.rb
pulitzer-0.3.2 app/models/pulitzer/content_element_type.rb
pulitzer-0.3.1 app/models/pulitzer/content_element_type.rb
pulitzer-0.3.0 app/models/pulitzer/content_element_type.rb
pulitzer-0.2.2 app/models/pulitzer/content_element_type.rb
pulitzer-0.2.1 app/models/pulitzer/content_element_type.rb
pulitzer-0.2.0 app/models/pulitzer/content_element_type.rb