Sha256: 58cb68fa8c3bbe8e13d6c1cc59b715b23b5916239d00f473b4c19a95816a5f4c

Contents?: true

Size: 369 Bytes

Versions: 3

Compression:

Stored size: 369 Bytes

Contents

module Beespew
  module Model
    extend ActiveSupport::Concern

    included do
      attr_accessor Beespew.attribute
      validate :beespew_honeypot_must_be_blank
    end

    def spam?
      send(Beespew.attribute).present?
    end

    private

    def beespew_honeypot_must_be_blank
      errors.add(:base, 'spam protection in place') if spam?
    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
beespew-1.0.0 lib/beespew/model.rb
beespew-0.2.0 lib/beespew/model.rb
beespew-0.1.0 lib/beespew/model.rb