Skip to content

Commit

Permalink
Changed returning with tap on guides
Browse files Browse the repository at this point in the history
  • Loading branch information
spastorino authored and fxn committed Jul 26, 2010
1 parent 37d82f2 commit fd589db
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion railties/guides/source/plugins.textile
Expand Up @@ -1274,7 +1274,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
Expand Down
2 changes: 1 addition & 1 deletion railties/guides/source/security.textile
Expand Up @@ -286,7 +286,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.sub! /\A.*(\\|\/)/, ''
Expand Down

0 comments on commit fd589db

Please sign in to comment.