Sha256: fa17e28047e9be1ce70d92ea53e9e88505defce87fc6759837477f8d1e742bc2

Contents?: true

Size: 571 Bytes

Versions: 9

Compression:

Stored size: 571 Bytes

Contents

module ActsAsScrubbable
  module Scrubbable


    def scrubbable?
      false
    end


    def acts_as_scrubbable(*scrubbable_fields)

      class_attribute :scrubbable_fields

      self.scrubbable_fields = {}

      scrubbable_fields.each do |_field|
        if _field.is_a? Hash
          self.scrubbable_fields[_field.keys.first] = _field.values.first
        else
          self.scrubbable_fields[_field] = _field
        end
      end

      class_eval do

        def self.scrubbable?
          true
        end

      end

      include Scrub
    end

  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
acts_as_scrubbable-0.0.9 lib/acts_as_scrubbable/scrubbable.rb
acts_as_scrubbable-0.0.8 lib/acts_as_scrubbable/scrubbable.rb
acts_as_scrubbable-0.0.7 lib/acts_as_scrubbable/scrubbable.rb
acts_as_scrubbable-0.0.6 lib/acts_as_scrubbable/scrubbable.rb
acts_as_scrubbable-0.0.5 lib/acts_as_scrubbable/scrubbable.rb
acts_as_scrubbable-0.0.4 lib/acts_as_scrubbable/scrubbable.rb
acts_as_scrubbable-0.0.3 lib/acts_as_scrubbable/scrubbable.rb
acts_as_scrubbable-0.0.2 lib/acts_as_scrubbable/scrubbable.rb
acts_as_scrubbable-0.0.1 lib/acts_as_scrubbable/scrubbable.rb