зеркало из
https://github.com/rs-pro/activeadmin-quill_editor.git
synced 2026-09-07 20:15:51 +03:00
test: Improve test suite setup
Этот коммит содержится в:
@@ -44,7 +44,7 @@ ActiveAdmin.register Post do
|
||||
f.input :author
|
||||
f.input :title
|
||||
f.input :summary, as: :quill_editor, input_html: { data: { options: { modules: { toolbar: toolbar } } } }
|
||||
f.input :description, as: :quill_editor, input_html: { data: { options: { modules: { toolbar: toolbar } } } }
|
||||
f.input :description, as: :quill_editor # using default options
|
||||
f.input :category
|
||||
f.input :dt
|
||||
f.input :position
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
ActiveAdmin.register Tag do
|
||||
permit_params :name
|
||||
end
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class Post < ApplicationRecord
|
||||
# enum state: %i[available unavailable arriving]
|
||||
|
||||
belongs_to :author, inverse_of: :posts, autosave: true
|
||||
|
||||
has_one :author_profile, through: :author, source: :profile
|
||||
@@ -28,12 +26,12 @@ class Post < ApplicationRecord
|
||||
end
|
||||
|
||||
class << self
|
||||
def ransackable_attributes(auth_object = nil)
|
||||
%w[author_id category created_at description dt id position published summary title updated_at]
|
||||
def ransackable_associations(_auth_object = nil)
|
||||
%w[author author_profile post_tags tags images_attachments images_blobs]
|
||||
end
|
||||
|
||||
def ransackable_associations(auth_object = nil)
|
||||
%w[author author_profile images_attachments images_blobs post_tags tags]
|
||||
def ransackable_attributes(_auth_object = nil)
|
||||
%w[author_id category created_at description dt id position published title summary updated_at]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -3,14 +3,12 @@
|
||||
class Profile < ApplicationRecord
|
||||
belongs_to :author, inverse_of: :profile, touch: true
|
||||
|
||||
# has_rich_text :description
|
||||
|
||||
# def to_s
|
||||
# description
|
||||
# end
|
||||
def to_s
|
||||
description
|
||||
end
|
||||
|
||||
class << self
|
||||
def ransackable_associations(auth_object = nil)
|
||||
def ransackable_associations(_auth_object = nil)
|
||||
%w[author]
|
||||
end
|
||||
|
||||
|
||||
Ссылка в новой задаче
Block a user