I think what you're looking for is "delegate" which is a rails extension to 
Module:

http://api.rubyonrails.org/classes/Module.html#method-i-delegate

class ModelC < ActiveRecord::Base
  has_many :model_a
end

class ModelA < ActiveRecord::Base
  belongs_to :model_c
  delegate :version, :to => :model_c
end

Then you can call version on a ModelA instance like you want to.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/rubyonrails-talk/-/579ERCsRs0QJ.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to