Sha256: ffbb9ddbb686d38b09969233d2aeed2f6a050d61b1d57e24353e0a5410d2815b

Contents?: true

Size: 333 Bytes

Versions: 12

Compression:

Stored size: 333 Bytes

Contents

module Pulitzer
  class ContentElementType < ActiveRecord::Base
    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

12 entries across 12 versions & 1 rubygems

Version Path
pulitzer-0.1.7 app/models/pulitzer/content_element_type.rb
pulitzer-0.1.6 app/models/pulitzer/content_element_type.rb
pulitzer-0.1.5 app/models/pulitzer/content_element_type.rb
pulitzer-0.1.4 app/models/pulitzer/content_element_type.rb
pulitzer-0.1.3 app/models/pulitzer/content_element_type.rb
pulitzer-0.1.2 app/models/pulitzer/content_element_type.rb
pulitzer-0.1.1 app/models/pulitzer/content_element_type.rb
pulitzer-0.1.0 app/models/pulitzer/content_element_type.rb
pulitzer-0.0.5 app/models/pulitzer/content_element_type.rb
pulitzer-0.0.4 app/models/pulitzer/content_element_type.rb
pulitzer-0.0.3 app/models/pulitzer/content_element_type.rb
pulitzer-0.0.2 app/models/pulitzer/content_element_type.rb