lib/ridgepole/schema_statements_ext.rb in ridgepole-0.7.3.beta vs lib/ridgepole/schema_statements_ext.rb in ridgepole-0.7.3.beta2
- old
+ new
@@ -2,13 +2,13 @@
module Ridgepole
module SchemaStatementsExt
def index_name_exists?(*)
if Ridgepole::ExecuteExpander.noop
- caller_methods = caller.map {|i| i =~ /:\d+:in `(.+)'/ ? $1 : '' }
- if caller_methods.any? {|i| i =~ /\Aremove_index/ }
+ caller_methods = caller.map { |i| i =~ /:\d+:in `(.+)'/ ? Regexp.last_match(1) : '' }
+ if caller_methods.any? { |i| i.start_with?('remove_index') }
true
- elsif caller_methods.any? {|i| i =~ /\Aadd_index/ }
+ elsif caller_methods.any? { |i| i.start_with?('add_index') }
false
else
super
end
else