Sha256: 05552f3224521f0948a8ba914c724e0ab7cb3958122bc662e57ab4bfe9bc3d8c

Contents?: true

Size: 591 Bytes

Versions: 5

Compression:

Stored size: 591 Bytes

Contents

# encoding: utf-8
module Freeberry
  module Models
    module Page
      def self.included(base)
        base.send :include, InstanceMethods
        base.send :extend,  ClassMethods
      end
      
      module ClassMethods
        def self.extended(base)
          base.class_eval do
            belongs_to :structure
            validates_presence_of :title, :content
          end
        end
      end
      
      module InstanceMethods
        def content_without_html
          return nil if self.content.blank?
          self.content.no_html
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
freeberry-0.3.0 lib/freeberry/models/page.rb
freeberry-0.2.9 lib/freeberry/models/page.rb
freeberry-0.2.7 lib/freeberry/models/page.rb
freeberry-0.2.6 lib/freeberry/models/page.rb
freeberry-0.2.5 lib/freeberry/models/page.rb