Method: ActiveModel::AttributeFilters#attribute_sets

Defined in:
lib/attribute-filters/dsl_sets.rb

#attribute_setsMetaSet{Symbol => AttributeSet<String>} Also known as: attributes_sets, properties_sets

Note:

Use key method explicitly to check if the given set exists. The hash returned by this method will always return ActiveModel::AttributeSet object. If there is no such set defined then the returned, matching set will be empty.

Gets all the defined attribute sets.

Returns:

  • (MetaSet{Symbol => AttributeSet<String>})

    the collection of attribute sets indexed by their names



170
171
172
173
174
175
176
# File 'lib/attribute-filters/dsl_sets.rb', line 170

def attribute_sets
  s = self.class.attribute_sets
  s.each_pair do |set_name, set_object|
    s[set_name] = ActiveModel::AttributeSet::Query.new(set_object, self)
  end
  s
end