Skip to content

Instantly share code, notes, and snippets.

@DGaffney
Created March 23, 2011 04:51
Show Gist options
  • Select an option

  • Save DGaffney/882639 to your computer and use it in GitHub Desktop.

Select an option

Save DGaffney/882639 to your computer and use it in GitHub Desktop.
Model.all(:fields => [...]).chunks(20) do |chunk|
keys = chunk.first.attributes.keys
chunk.each do |row|
row_keys = keys.collect{|k| row.attributes[k]}#<< Immutable error thrown
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment