airblade/paper_trail — pull request #235 by linkrjr (2013-06-11 06:26:39+00:00)
Title: fixed undefined method version_key for ActiveRecord::Associations::JoinD...

The missing version_key method error can be simulated by running a simple join on versions

Ex.: Address.joins(:versions).where("unit_number = ':n'", :n => 1000).to_a

Where the address and the custom version classes are defined as follows

class Address < ActiveRecord::Base
has_paper_trail :class_name => 'AddressVersion', :on => [:update], :meta => {:unit_number => :unit_number, :house_number => :house_number, :house_suffix => :house_suffix}
end

class AddressVersion < Version
self.table_name = :address_versions
attr_accessible :unit_number, :house_number, :house_suffix, :event, :object, :whodunnit
end