Sha256: 8a8437329748509478b9dd7e3974815af0d2a07579ceabb6b75f9d9c20a523bc

Contents?: true

Size: 432 Bytes

Versions: 6

Compression:

Stored size: 432 Bytes

Contents

module Wafflemix
  class ContentSection < ActiveRecord::Base
    attr_accessible :content, :contentable_id, :contentable_type, :name

    belongs_to :contentable, :polymorphic => true

    def self.title
    	self.name.downcase.parameterize
    end

		def self.content_for(name)
      part = where('lower(name) LIKE ?', "%#{name.downcase}%").first
      if part
			  part.content
      else
        false
      end
		end

  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
wafflemix-0.0.6 app/models/wafflemix/content_section.rb
wafflemix-0.0.5 app/models/wafflemix/content_section.rb
wafflemix-0.0.4 app/models/wafflemix/content_section.rb
wafflemix-0.0.3 app/models/wafflemix/content_section.rb
wafflemix-0.0.2 app/models/wafflemix/content_section.rb
wafflemix-0.0.1 app/models/wafflemix/content_section.rb