Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Support/bin/insert_add_column_or_create_table.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def unprepend(text, prefix)
end

# Find 'self.down' method
if self_down = buffer.find { /^(\s*)def\s+self\.down\b/ }
if self_down = buffer.find { /^(\s*)def\s+(self\.|)down\b/ }
indentation = self_down[1]

# Find the matching create_table clause in the schema.rb file
Expand Down
2 changes: 1 addition & 1 deletion Support/bin/intelligent_migration_snippet.rb
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def insert_migration(snippet, text)
# find the beginning of self.down and insert down code, this is hardly robust.
# assuming self.down is after self.up in the class
lines.each_with_index do |line, i|
if line =~ /^\s*def\s+self\.down\b/
if line =~ /^\s*def\s+(self\.|)down\b/
lines[i, 1] = [lines[i], down_code]
break
end
Expand Down