Этот коммит содержится в:
Mattia Roccoberton
2023-08-20 21:08:52 +02:00
родитель cd7f259697
Коммит c1c2391cb8
8 изменённых файлов: 200 добавлений и 499 удалений

Просмотреть файл

@@ -23,4 +23,8 @@ class Author < ApplicationRecord
def to_s
"#{name} (#{age})"
end
def self.ransackable_attributes(auth_object = nil)
%w[age created_at email id name updated_at]
end
end

Просмотреть файл

@@ -26,4 +26,12 @@ class Post < ApplicationRecord
def upper_title
title.upcase
end
def self.ransackable_attributes(auth_object = nil)
%w[author_id category created_at description dt id position published summary title updated_at]
end
def self.ransackable_associations(auth_object = nil)
%w[author author_profile images_attachments images_blobs post_tags tags]
end
end

Просмотреть файл

@@ -6,4 +6,8 @@ class PostTag < ApplicationRecord
validates :post, presence: true
validates :tag, presence: true
def self.ransackable_attributes(auth_object = nil)
%w[created_at id post_id tag_id updated_at]
end
end

Просмотреть файл

@@ -6,4 +6,8 @@ class Profile < ApplicationRecord
def to_s
description
end
def self.ransackable_attributes(auth_object = nil)
%w[author_id created_at description id updated_at]
end
end

Просмотреть файл

@@ -0,0 +1,7 @@
ActiveSupport::Reloader.to_prepare do
ActiveStorage::Attachment.class_eval do
def self.ransackable_attributes(auth_object = nil)
%w[blob_id created_at id name record_id record_type]
end
end
end