rails8-memoapp/app/models/memo.rb

14 lines
289 B
Ruby
Raw Normal View History

2025-02-20 22:46:52 +09:00
class Memo < ApplicationRecord
belongs_to :user
has_one_attached :image
2025-02-20 22:46:52 +09:00
validates :content, presence: true
def self.ransackable_attributes(_auth_object = nil)
%w[content created_at id updated_at]
end
def self.ransackable_associations(_auth_object = nil)
[]
2025-02-20 22:46:52 +09:00
end
end