Sha256: 52ebbbb2445c06da2eaade47ab81b16313d272bcaa2d34c0200d7f2c3acce196
Contents?: true
Size: 678 Bytes
Versions: 10
Compression:
Stored size: 678 Bytes
Contents
# encoding: utf-8 module Sunrise module Utils module Header def self.included(base) base.send(:extend, ClassMethods) base.send(:include, InstanceMethods) end module ClassMethods def self.extended(base) base.class_eval do has_one :header, :as => :headerable, :dependent => :delete attr_accessible :header_attributes accepts_nested_attributes_for :header, :reject_if => :all_blank end end end module InstanceMethods def default_header header || build_header end end end end end
Version data entries
10 entries across 10 versions & 2 rubygems