New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Jl services update script #76
Conversation
ActiveRecord::Base.transaction do | ||
CSV.foreach(input_file, :headers => true) do |row| | ||
service = Service.find(row['service_id'].to_i) | ||
service = Service.where(id: row['Service ID'].to_i).first |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's wrong with #find
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True, then you could leave off the #first
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem is with the import file. There are a bunch of null values after the last service row. The 'where' handles this.
No description provided.