lib/vestal_versions/users.rb in houston-vestal_versions-2.0.1 vs lib/vestal_versions/users.rb in houston-vestal_versions-3.0.0

- old
+ new

@@ -9,12 +9,12 @@ Version.class_eval{ include UserVersionMethods } end # Methods added to versioned ActiveRecord::Base instances to enable versioning with additional # user information. - - + + private # Overrides the +version_attributes+ method to include user information passed into the # parent object, by way of a +updated_by+ attr_accessor. def version_attributes super.merge(:user => updated_by) @@ -26,11 +26,16 @@ extend ActiveSupport::Concern included do belongs_to :user, :polymorphic => true - alias_method_chain :user, :name - alias_method_chain :user=, :name + # alias_method_chain :user, :name + alias_method :user_without_name, :user + alias_method :user, :user_with_name + + # alias_method_chain :user=, :name + alias_method :user_without_name=, :user= + alias_method :user=, :user_with_name= end # Overrides the +user+ method created by the polymorphic +belongs_to+ user association. If # the association is absent, defaults to the +user_name+ string column. This allows # VestalVersions::Version#user to either return an ActiveRecord::Base object or a string,