Skip to content

Instantly share code, notes, and snippets.

@levicole
Created July 9, 2010 20:28
Show Gist options
  • Select an option

  • Save levicole/470016 to your computer and use it in GitHub Desktop.

Select an option

Save levicole/470016 to your computer and use it in GitHub Desktop.
user.plugins.create(:title => "Blog", :position => (user.plugins.maximum(:position) || -1) +1)
# should be
user.plugins.create(:name => "Blog", :position => (user.plugins.maximum(:position) || -1) +1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment