Skip to content

Instantly share code, notes, and snippets.

@harshalbhakta
Last active August 29, 2015 14:03
Show Gist options
  • Select an option

  • Save harshalbhakta/d9d8bbadd91aebf9b550 to your computer and use it in GitHub Desktop.

Select an option

Save harshalbhakta/d9d8bbadd91aebf9b550 to your computer and use it in GitHub Desktop.
Single line rails console commands.
$ User.all.each {|user| user.update_attributes(:active => true) }
$ (1..100).each { InfoPack.find(246).sections.each { |s| s.sub_items.each { |si| si.update_attributes(:active => true) } } }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment