• K
    Add method to confirm rich text content existence by adding ? after content name · 07533a3d
    Kyohei Toyoda 提交于
    This change introduces a rich text object to make
    it easier to confirm it context is existing or not.
    
    If we have a class like below.
    
    class Information < ApplicationRecord
      has_rich_text :notes
    end
    
    Before:
    i = Information.new
    i.notes? => NoMethodError
    i.notes = "Some sample text"
    i.notes.present? => true
    
    After:
    i = Information.new
    i.notes? => false
    
    i.notes = "Some sample text"
    i.notes? => true
    07533a3d
attribute.rb 2.0 KB