Permalink
Browse files

Changes Object#returning with Object#tap on guides

  • Loading branch information...
1 parent 6f38967 commit ae63d5c90d40e0cb22e127b49c4d8020a3eb1228 @spastorino spastorino committed with tenderlove Jul 26, 2010
Showing with 2 additions and 2 deletions.
  1. +1 −1 railties/guides/source/plugins.textile
  2. +1 −1 railties/guides/source/security.textile
@@ -1272,7 +1272,7 @@ class YaffleMigrationGenerator < Rails::Generator::NamedBase
end
def yaffle_local_assigns
- returning(assigns = {}) do
+ {}.tap do |assigns|
assigns[:migration_action] = "add"
assigns[:class_name] = "add_yaffle_fields_to_#{custom_file_name}"
assigns[:table_name] = custom_file_name
@@ -288,7 +288,7 @@ When filtering user input file names, _(highlight)don't try to remove malicious
<ruby>
def sanitize_filename(filename)
- returning filename.strip do |name|
+ filename.strip.tap do |name|
# NOTE: File.basename doesn't work right with Windows paths on Unix
# get only the filename, not the whole path
name.gsub! /^.*(\\|\/)/, ''

0 comments on commit ae63d5c

Please sign in to comment.