Skip to content

Instantly share code, notes, and snippets.

@ascot21
Created April 11, 2013 15:13
Show Gist options
  • Save ascot21/5364199 to your computer and use it in GitHub Desktop.
Save ascot21/5364199 to your computer and use it in GitHub Desktop.
working on Rails find_by_or_create
@badge = Badge.find_or_create_by_name_and_user_id(:name => @badge_name,:user_id => current_user.id, :date_approved => "2013-04-10", :completed_credits => 1, :status => 1, :badge_type_id => 12, :user_id => current_user.id).where("status = 1")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment