Class: PostType
- Inherits:
-
ApplicationRecord
- Object
- ApplicationRecord
- PostType
show all
- Includes:
- StringLengthLimit
- Defined in:
- app/models/post_type.rb
Constant Summary
StringLengthLimit::STRING_LIMIT
Instance Method Summary
collapse
Instance Method Details
#name_is_not_read ⇒ Object
13
14
15
|
# File 'app/models/post_type.rb', line 13
def name_is_not_read
errors.add(:name, I18n.t("errors.article_type_already_exist")) if name == "read"
end
|
#sanitize_title ⇒ Object
17
18
19
|
# File 'app/models/post_type.rb', line 17
def sanitize_title
self.permalink = name.to_permalink
end
|