--- original
+++ mutation
defself.chown(options ={})
options = options.dup
options[:audit]=trueunless options.has_key?(:audit)
options[:column]||=:userif options[:column].is_a?(Symbol)then
options[:column]="#{options[:column]}_id"endcase options[:from]whennilthenraise(ArgumentError,"If you really meant to change ownership of all #{table_name}, specify :all for the :from option.")when:allthen
chown(options.merge({:from=>[]}))whenArraythen
to =if options[:to].is_a?(ActiveRecord::Base)then
options[:to].id
else
options[:to]end- from = options[:from].map do |u|+ from =nildo |u|if u.is_a?(ActiveRecord::Base)then
u.id
else
u
endend