Sha256: a9d379ee676611f35480ecb7226d1c46df68a58b8b8238eaf782ee2ef50c0ccc

Contents?: true

Size: 517 Bytes

Versions: 1

Compression:

Stored size: 517 Bytes

Contents

# encoding: utf-8
module Freeberry
  module Models
    module Header
      def self.included(base)
        base.send :include, InstanceMethods
        base.send :extend,  ClassMethods
      end
      
      module ClassMethods
        def self.extended(base)
          base.class_eval do
            validates_presence_of :headerable_type, :headerable_id
    
            belongs_to :headerable, :polymorphic => true
          end
        end
      end
      
      module InstanceMethods
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
freeberry-0.2.5 lib/freeberry/models/header.rb