зеркало из
https://github.com/rs-pro/activeadmin-quill_editor.git
synced 2026-09-07 04:05:49 +03:00
Add specs for editor in nested resources
Этот коммит содержится в:
@@ -12,6 +12,7 @@ class Author < ApplicationRecord
|
||||
has_one_attached :avatar
|
||||
|
||||
accepts_nested_attributes_for :profile, allow_destroy: true
|
||||
accepts_nested_attributes_for :posts, allow_destroy: true
|
||||
|
||||
validates :email, format: { with: /\A[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}\z/i, message: 'Invalid email' }
|
||||
|
||||
|
||||
@@ -10,6 +10,10 @@ class Post < ApplicationRecord
|
||||
has_many :post_tags, inverse_of: :post, dependent: :destroy
|
||||
has_many :tags, through: :post_tags
|
||||
|
||||
has_many_attached :images
|
||||
|
||||
accepts_nested_attributes_for :post_tags, allow_destroy: true
|
||||
|
||||
validates :title, allow_blank: false, presence: true
|
||||
|
||||
scope :published, -> { where(published: true) }
|
||||
|
||||
Ссылка в новой задаче
Block a user