1
0
Fork 0
mirror of https://github.com/heartcombo/devise.git synced 2022-11-09 12:18:31 -05:00

Fix description of find_or_initialize_with_error methods

[ci skip]
This commit is contained in:
Prathamesh Sonpatki 2014-12-12 09:25:25 +05:30
parent a9d90503e9
commit 13c2d4e807

View file

@ -252,12 +252,12 @@ module Devise
to_adapter.find_first(devise_parameter_filter.filter(tainted_conditions).merge(opts))
end
# Find an initialize a record setting an error if it can't be found.
# Find or initialize a record setting an error if it can't be found.
def find_or_initialize_with_error_by(attribute, value, error=:invalid) #:nodoc:
find_or_initialize_with_errors([attribute], { attribute => value }, error)
end
# Find an initialize a group of attributes based on a list of required attributes.
# Find or initialize a record with group of attributes based on a list of required attributes.
def find_or_initialize_with_errors(required_attributes, attributes, error=:invalid) #:nodoc:
attributes = attributes.slice(*required_attributes).with_indifferent_access
attributes.delete_if { |key, value| value.blank? }