Hi folks!
I just want to know the name of the relationship between ActiveRecord and Base.
Thanks!!!
Hi folks!
I just want to know the name of the relationship between ActiveRecord and Base.
Thanks!!!
ActiveRecord is a global which refers to a Ruby module. One of the functions of a module in Ruby is to define a name space.
ActiveRecord::Base is a constant defined in the ActiveRecord name space, which happens to refer to a class.
Name spacing allows for the existence of, and distinction between say:
ActiveRecord::Base vs ActionController::Base vs ActionView::Base
etc.
Thanks a lot Rick!