Agile Web Development with Rails 3.2

Agile Web Development with Rails 3.2

I assume the method paginate for in
@orders = Order.paginate page: params[:page], order: ‘created_at desc’, per_page: 10@
is from the will_paginate gem that we added in this iteration. But what I don’t understand, Order is an ActiveRecord::Base sublcass, how can an external gem add a new method definition to it?

Similar to this erb,
@<p><%= will_paginate @orders %></p>@
Does it mean that @will_paginate@ method is added to the controller clase?