Skip to content

Instantly share code, notes, and snippets.

@skord
Created March 5, 2012 17:05
Show Gist options
  • Save skord/1979367 to your computer and use it in GitHub Desktop.
Save skord/1979367 to your computer and use it in GitHub Desktop.
method to update dhct
def self.update_dhct_profile(file_record)
mac = file_record[0]
ip_address = file_record[1]
admin_status = file_record[2]
oper_status = file_record[3]
oui = file_record[4]
dhct_model = file_record[5]
dhct_model_revision = file_record[6]
qmod_reference = file_record[7]
qdemod_reference = file_record[8]
dhct = Dhct.find_or_create_by(:mac => mac, :dhct_model => dhct_model, :dhct_model_revision => dhct_model_revision, :oui => oui)
dhct.admin_status= admin_status
dhct.oper_status= oper_status
dhct.qmod_reference= qmod_reference
dhct.qdemod_reference= qdemod_reference
dhct.save
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment