Class: PostType

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

Instance Method Summary collapse

Instance Method Details

#name_is_not_readObject



9
10
11
# File 'app/models/post_type.rb', line 9

def name_is_not_read
  errors.add(:name, I18n.t("errors.article_type_already_exist")) if name == "read"
end

#sanitize_titleObject



13
14
15
# File 'app/models/post_type.rb', line 13

def sanitize_title
  self.permalink = name.to_permalink
end