Module: Gutentag::ActiveRecord::ClassMethods

Defined in:
lib/gutentag/active_record/class_methods.rb

Instance Method Summary collapse

Instance Method Details

#attribute_cast_code(attr_name) ⇒ Object



19
20
21
# File 'lib/gutentag/active_record/class_methods.rb', line 19

def attribute_cast_code(attr_name)
  attr_name == "tag_names" ? "v" : super
end

#create_time_zone_conversion_attribute?(attr_name, column) ⇒ Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/gutentag/active_record/class_methods.rb', line 15

def create_time_zone_conversion_attribute?(attr_name, column)
  attr_name != "tag_names" && super
end

#skip_time_zone_conversion_for_attributesObject



9
10
11
# File 'lib/gutentag/active_record/class_methods.rb', line 9

def skip_time_zone_conversion_for_attributes
  super + [:tag_names]
end

#tagged_with(options) ⇒ Object



4
5
6
# File 'lib/gutentag/active_record/class_methods.rb', line 4

def tagged_with(options)
  Gutentag::TaggedWith.call self, options
end