Is there anyway to call "update_attributes" where it updates only the attributes you specify with the update command. The only thing close to this is update_all where you have to specify the condition. So essentially you''d be stuck doing "id=#{obj.id}" as the condition. Are there any built in AR functions that allow you to update a particular object using straight sql UPDATE without saving all the attributes (ie, updating only the attributes you designate.) In any case, I extended ActiveRecord::Base to do something like this. Here is my function: def update_attributes_with_sql(attributes) # allows you to update individual columns without saving the whole record (also much faster) update_sql = if attributes.is_a?(Hash) attributes.to_a.collect do |key_value| k, v = key_value v = v.to_s(:db) if v.is_a?(Time) v = "''#{v}''" if v.is_a?(String) %{#{k.to_s}=#{v}} end.join(", ") else attributes end self.class.update_all update_sql, "id=#{id}" end Let me know if there is already something like this is in RoR. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---