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

Rename get_message to find_message and fix set_flash_message

This commit is contained in:
Łukasz Niemier 2013-04-07 08:52:11 +02:00
parent 8e9ad4626e
commit 95f56258d7

View file

@ -163,12 +163,13 @@ MESSAGE
#
# Please refer to README or en.yml locale file to check what messages are
# available.
def set_flash_message(key, kind, options={})
flash[key] = get_message(kind, options) if message.present?
def set_flash_message(key, kind, options = {})
message = find_message(kind, options)
flash[key] = message if message.present?
end
# Get message for given
def get_message(kind, options = {})
def find_message(kind, options = {})
options[:scope] = "devise.#{controller_name}"
options[:default] = Array(options[:default]).unshift(kind.to_sym)
options[:resource_name] = resource_name