Sha256: 2ee803e89bf8289cec958807f3ef8b9324cd4b2b7b39e5fae58be8338bb9831a
Contents?: true
Size: 850 Bytes
Versions: 1
Compression:
Stored size: 850 Bytes
Contents
module Form extend ActiveSupport::Concern included do attr_accessor :_subtitle validates :_subtitle, invisible_captcha: true before_save :set_locale after_save :send_email, if: :with_email? delegate :virtual?, :has_attachments?, :has_collections?, to: :class end class_methods do def virtual? false end def has_attachments? respond_to? :attachments end def has_collections? respond_to? :collections end def has_collections(*collections) define_singleton_method :collections do collections end delegate :collections, to: :class end end private def set_locale if has_attribute?(:locale) && locale.nil? self.locale = I18n.locale end end def send_email CMS::FormsMailer.send_email(self).deliver_now end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
rails_admin_cms-0.1.1 | app/models/form.rb |