Class: PostType

Inherits:
ApplicationRecord
  • Object
show all
Includes:
StringLengthLimit
Defined in:
app/models/post_type.rb

Constant Summary

Constants included from StringLengthLimit

StringLengthLimit::STRING_LIMIT

Instance Method Summary collapse

Instance Method Details

#name_is_not_readObject



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_titleObject



17
18
19
# File 'app/models/post_type.rb', line 17

def sanitize_title
  self.permalink = name.to_permalink
end