We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Please go to http://rails-bestpractices.com/posts/15-the-law-of-demeter
Before:
class Invoice < ActiveRecord::Base belongs_to :user end <%= @invoice.user.name %> <%= @invoice.user.address %> <%= @invoice.user.cellphone %>
After:
class Invoice < ActiveRecord::Base belongs_to :user delegate :name, :address, :cellphone, :to => :user, :prefix => true end <%= @invoice.user_name %> <%= @invoice.user_address %> <%= @invoice.user_cellphone %>