Class: Tag
The Tag model. This model is automatically generated and added to your app if you run the tagging generator included with has_many_polymorphs.
Child modules and classes
Class Tag::Error
Constants
| Name | Value |
|---|---|
| DELIMITER | " " |
Public Instance Methods
before_create ()
Callback to strip extra spaces from the tagname before saving it. If you allow tags to be renamed later, you might want to use the before_save callback instead.
# File generators/tagging/templates/tag.rb, line 31 31: def before_create 32: self.name = name.downcase.strip.squeeze(" ") 33: end