module CustomFields::Types::Tags::Target::ClassMethods
Public Instance Methods
apply_tags_custom_field(klass, rule)
click to toggle source
Calls superclass method
# File lib/custom_fields/types/tags.rb, line 12 def apply_tags_custom_field(klass, rule) klass.field rule['name'], localize: rule['localized'] || false, type: Array klass.class_eval do define_method("#{rule['name']}=") do |val| # FIXME: I would use is_a?(), but it doesn't work in my machine! val = val.split(/ *, */) if val.class.to_s == 'String' super(val) end end end
tags_attribute_get(instance, name)
click to toggle source
# File lib/custom_fields/types/tags.rb, line 24 def tags_attribute_get(instance, name) default_attribute_get(instance, name) end
tags_attribute_set(instance, name, attributes)
click to toggle source
# File lib/custom_fields/types/tags.rb, line 28 def tags_attribute_set(instance, name, attributes) default_attribute_set(instance, name, attributes) end