lib/extensions/ar_virtual.rb
# Compatibility method: `virtual_attribute` is a more accurate name
Compatibility method: `virtual_attribute` is a more accurate name
Compatibility method : ` virtual_attribute ` is a more accurate name
def load_schema!
      super
      virtual_attributes_to_define.each do |name, (type, options)|
        type = type.call if type.respond_to?(:call)
        type = ActiveRecord::Type.lookup(type, **options.except(:uses, :arel)) if type.kind_of?(Symbol)
        define_virtual_attribute(name, type, **options.slice(:uses, :arel))
      end
      virtual_delegates_to_define.each do |method_name, (method, options)|
        define_virtual_delegate(method_name, method, options)
      end
    end
def load_schema! super virtual_attributes_to_define . each do | name , ( type , options ) | type = type . call if type . respond_to? ( :call ) type = ActiveRecord :: Type . lookup ( type , ** options . except ( :uses , :arel ) ) if type . kind_of? ( Symbol ) define_virtual_attribute ( name , type , ** options . slice ( :uses , :arel ) ) end virtual_delegates_to_define . each do | method_name , ( method , options ) | define_virtual_delegate ( method_name , method , options ) end end
Compatibility method: `virtual_attribute` is a more accurate name
Compatibility method : ` virtual_attribute ` is a more accurate name