Skip to content
  • Jacopo's avatar
    c2fc8626
    compute_class raise when klass is not ActiveRecord::Base subclass · c2fc8626
    Jacopo authored
    Changes `ActiveRecord::Reflection#compute_class` in order to raise
    an `ArgumentError` when the computed class is not a subclass
    of `ActiveRecord::Base`.
    
    Raising a meaningful error ease the user interaction in the following
    scenarios:
    
    - Rails couldn't compute correctly the `class_name`
    - User sets as `:class_name` an invalid class
    
    Closes #15811.
    c2fc8626
    compute_class raise when klass is not ActiveRecord::Base subclass
    Jacopo authored
    Changes `ActiveRecord::Reflection#compute_class` in order to raise
    an `ArgumentError` when the computed class is not a subclass
    of `ActiveRecord::Base`.
    
    Raising a meaningful error ease the user interaction in the following
    scenarios:
    
    - Rails couldn't compute correctly the `class_name`
    - User sets as `:class_name` an invalid class
    
    Closes #15811.
Loading