I have user model which has description as rich text
has_rich_text :description
I want to run a query to check which users have a description present?
Something like this
User.where.not(description: nil)
My question:
- is it possible to check action text presence?
- can create a migration on User model has_description(boolean) and update on
before_save
& then run querywhere has_description true
Rails automatically adds a
has_one
associationrich_text_#{name}
:You can use it to join (or preload) the association and filter out the internal Action Text table: