Skip to content

Instantly share code, notes, and snippets.

@everm1nd
Created April 16, 2012 14:20
Show Gist options
  • Save everm1nd/2399113 to your computer and use it in GitHub Desktop.
Save everm1nd/2399113 to your computer and use it in GitHub Desktop.
Ruby: Working with options
options = { :allow_destroy => false, :update_only => false }
options.update(attr_names.extract_options!)
options.assert_valid_keys(:allow_destroy, :reject_if, :limit, :update_only)
options[:reject_if] = REJECT_ALL_BLANK_PROC if options[:reject_if] == :all_blank
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment