Sha256: 015682e4286e7bb91175c6049c93a5919f22d87812ee473a4672495ce4ee1337
Contents?: true
Size: 695 Bytes
Versions: 11
Compression:
Stored size: 695 Bytes
Contents
# -*- encoding : utf-8 -*- module AbAdmin module Concerns module Headerable extend ActiveSupport::Concern included do has_one :header, as: :headerable, dependent: :delete attr_accessible :header_attributes accepts_nested_attributes_for :header, reject_if: :all_blank ::Header.all_translated_attribute_names.each do |attr| define_method "header_#{attr}=" do |val| default_header.send("#{attr}=", val) end define_method "header_#{attr}" do default_header.send(attr) end end end def default_header header || build_header end end end end
Version data entries
11 entries across 11 versions & 1 rubygems