Skip to content
Snippets Groups Projects
Unverified Commit bca11721 authored by Sébastien Gaya's avatar Sébastien Gaya
Browse files

fix

parent f77f53b4
No related branches found
Tags v3.1.1
No related merge requests found
......@@ -47,7 +47,11 @@ class Communication::Extranet::Post::Category::Localization < ApplicationRecord
def slug_unavailable?(slug)
self.class.unscoped
.where(extranet_id: self.extranet_id, slug: slug)
.where(
extranet_id: self.extranet_id,
language_id: self.language_id,
slug: slug
)
.where.not(id: self.id)
.exists?
end
......
......@@ -44,9 +44,9 @@ class Communication::Extranet::Post::Localization < ApplicationRecord
include WithUniversity
belongs_to :extranet, class_name: 'Communication::Extranet'
has_summernote :summary
validates :title, presence: true
before_validation :set_extranet_id, on: :create
......@@ -62,7 +62,11 @@ class Communication::Extranet::Post::Localization < ApplicationRecord
def slug_unavailable?(slug)
self.class.unscoped
.where(extranet_id: self.extranet_id, slug: slug)
.where(
extranet_id: self.extranet_id,
language_id: self.language_id,
slug: slug
)
.where.not(id: self.id)
.exists?
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment