Module: HasEnumeration::Arel::TableExtensionsArelOne
- Defined in:
- lib/has_enumeration/arel/table_extensions_arel_one.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.included(base) ⇒ Object
6 7 8 9 10 11 12 13 14 |
# File 'lib/has_enumeration/arel/table_extensions_arel_one.rb', line 6 def self.included(base) base.class_eval do alias_method_chain :attributes, :has_enumeration def self.has_enumeration_mappings @has_enumeration_mappings ||= Hash.new {|h,k| h[k] = Hash.new} end end end |
Instance Method Details
#attributes_with_has_enumeration ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/has_enumeration/arel/table_extensions_arel_one.rb', line 16 def attributes_with_has_enumeration return @attributes if @attributes attrs = attributes_without_has_enumeration mappings = self.class.has_enumeration_mappings[name] if mappings mappings.each do |attr_name, mapping| attr = attrs[attr_name] install_has_enumeration_attribute_mapping(attr, mapping) end end attrs end |