module CensorBear class Log < ApplicationRecord belongs_to :user, class_name: CensorBear.config.user_class, optional: true def suggestion return nil if response.blank? response['data']&.first['results']&.first['suggestion'] end def rate return nil if response.blank? response['data']&.first['results']&.first['rate'] end def label return nil if response.blank? response['data']&.first['results']&.first['label'] end end end