Skip to content

Instantly share code, notes, and snippets.

@skamithi
Created June 24, 2013 05:58
Show Gist options
  • Save skamithi/5848000 to your computer and use it in GitHub Desktop.
Save skamithi/5848000 to your computer and use it in GitHub Desktop.
create a ruby function with defaults
# Default value for :user_id is generated in this function
def create_project(options = {})
options.reverse_merge!(
:user_id => @user.id
)
FactoryGirl.create(:new_project, options)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment