I don't think you will need a before update callback since it really isn't a hook that you need here but rather just another variable to compare against. you can do the comparison inside the update_attrubutes if statement and save the results to your log table there.
Code:
def update_job
@job = Job.find(params[:id]) # this gets updated
@old_job = Job.find(params[:id]) # this stays the same so you can compare
if @job.update_attributes(params[:job]) # @job should now be updated
log = ""
for key, value in @job.attributes # goes through every attribute in @job
unless value == @old_job[key] # checks with the old version
log << "#{key} was changed from #{@old_job[key]} to #{value}.\n" # appends log if different
end
# Here you can save the changes to the DB as seperate entries
end
# Here you can save the log to the DB as one entry
end
end
Bookmarks