test: update test suite config

Этот коммит содержится в:
Mattia Roccoberton
2024-02-26 09:11:31 +01:00
родитель 2215c7337b
Коммит c935e16d25
21 изменённых файлов: 59 добавлений и 27 удалений

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

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

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

@@ -1,7 +1,7 @@
# frozen_string_literal: true
class Post < ApplicationRecord
enum state: %i[available unavailable arriving]
# enum state: %i[available unavailable arriving]
belongs_to :author, inverse_of: :posts, autosave: true
@@ -27,11 +27,13 @@ class Post < ApplicationRecord
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
class << self
def 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]
def ransackable_associations(auth_object = nil)
%w[author author_profile images_attachments images_blobs post_tags tags]
end
end
end

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

@@ -7,7 +7,9 @@ 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]
class << self
def ransackable_attributes(auth_object = nil)
%w[created_at id post_id tag_id updated_at]
end
end
end

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

@@ -3,11 +3,19 @@
class Profile < ApplicationRecord
belongs_to :author, inverse_of: :profile, touch: true
def to_s
description
end
# has_rich_text :description
def self.ransackable_attributes(auth_object = nil)
%w[author_id created_at description id updated_at]
# def to_s
# description
# end
class << self
def ransackable_associations(auth_object = nil)
%w[author]
end
def ransackable_attributes(_auth_object = nil)
%w[author_id created_at description id updated_at]
end
end
end

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

@@ -3,4 +3,14 @@
class Tag < ApplicationRecord
has_many :post_tags, inverse_of: :tag, dependent: :destroy
has_many :posts, through: :post_tags
class << self
def ransackable_associations(auth_object = nil)
%w[post_tags posts]
end
def ransackable_attributes(auth_object = nil)
%w[created_at id id_value name updated_at]
end
end
end