lib/dir_model/import.rb in dir_model-0.6.2 vs lib/dir_model/import.rb in dir_model-0.7.0
- old
+ new
@@ -88,13 +88,11 @@
def find_match
@_match = (source_path||'').match(get_regexp)
end
def get_regexp
- if foreign_value
- Regexp.new(self.class.options[:regex].call(foreign_value), Regexp::IGNORECASE)
- else
- self.class.options[:regex].call
- end
+ args = []
+ args << foreign_value if foreign_value
+ instance_exec(*args, &self.class.options[:regex])
end
end
end