Add paranoid behavior to translations of paranoid models
We want to be able to fetch soft deleted translations without using with_deleted scope.
This commit is contained in:
committed by
voodoorai2000
parent
2e8e7b83a5
commit
1de23fc726
@@ -16,6 +16,10 @@ module Globalizable
|
|||||||
def description
|
def description
|
||||||
self.read_attribute(:description).try :html_safe
|
self.read_attribute(:description).try :html_safe
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if self.paranoid?
|
||||||
|
translation_class.send :acts_as_paranoid, column: :hidden_at
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
class_methods do
|
class_methods do
|
||||||
|
|||||||
Reference in New Issue
Block a user