I have found a few posts on various sites that this was something that
was going to be available. The posts were all over a year ago, but it
doesn't seem like it is available in 1.2 unless I am missing something
(which I hope is true)
I have a member and office table that each have an address. Any
advice on the best way to do this. I have also seen a few posts
saying to use delegates, but without much info on how to do so and I
can't find any info on delegates in the docs.
Any advice on the best way to make these relationships is appreciated.
first 2 yes, last one no.
if I take the long approach of creating a get and set method, is there
a short way to make the association between the address and member
table without having to create a model out of the associative table?
@address = Address.find_by_member_id(self.id) unless
@address = value
#connect the tables here
or there is this way, but now I have a address collection within the
model. It is rather difficult to believe that Rails would not have a
better way of making associations of this sort.
has_and_belongs_to_many :addresses, :join_table
return self.addresses unless self.addresses.nil?
self.addresses = if self.addresses.nil?
self.addresses << value
the guy who wrote the second article reference, Ryan Heneise, is
working on a patch for Rails to add the has_one :through.
In my case I have an address table that is linked to a few tables
within the database. It turns out that in my case polymorphic
association is probably the best bet anyway.
Thanks for letting me know though, I am sure the plugin will come in