Module: ActiveModel::AttributeFilters::Common::ClassMethods

Defined in:
lib/attribute-filters/common_filters.rb,
lib/attribute-filters/common_filters/order.rb

Overview

This submodule contains class methods used to easily define filter.

Instance Method Summary collapse

Instance Method Details

#shuffle_attributes(*args) ⇒ Object Also known as: shuffle_attribute, shuffles_attribute, shuffles_attributes

Registers attributes that should be shuffled.



89
90
91
92
93
94
95
# File 'lib/attribute-filters/common_filters/order.rb', line 89

def shuffle_attributes(*args)
  setup_attributes_that :should_be_shuffled, args,
    {
      :shuffle_enumerable => [:enum, :enums, :whole_enums, :shuffle_enums, :shuffle_enumerable],
      :shuffle_generator  => [:random_generator, :generator, :rnd, :rng, :shuffle_generator]
    }, :shuffle_generator
end