You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ActiveRecord supports STI (Single Table Inheritance) via class inheritation.
If the parent class of the STI model has enum definitions, scopes, and so on, the child classes can use them also.
Example:
class User < ActiveRecord::Base
scope :active, -> { where(is_active: 1) }
end
class AdminUser < User
end
AdminUser.active # scopes defined in the parent class are available in the child classes.
The text was updated successfully, but these errors were encountered:
ActiveRecord supports STI (Single Table Inheritance) via class inheritation.
If the parent class of the STI model has enum definitions, scopes, and so on, the child classes can use them also.
Example:
The text was updated successfully, but these errors were encountered: