aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb4
-rw-r--r--activerecord/lib/active_record/connection_adapters/mysql_adapter.rb30
-rw-r--r--activeresource/lib/active_resource/schema.rb2
-rw-r--r--activesupport/lib/active_support/core_ext/logger.rb2
4 files changed, 19 insertions, 19 deletions
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb b/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb
index e42cd99786..7d58bc2adf 100644
--- a/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb
+++ b/activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb
@@ -494,7 +494,7 @@ module ActiveRecord
end
%w( string text integer float decimal datetime timestamp time date binary boolean ).each do |column_type|
- class_eval <<-EOV
+ class_eval <<-EOV, __FILE__, __LINE__ + 1
def #{column_type}(*args) # def string(*args)
options = args.extract_options! # options = args.extract_options!
column_names = args # column_names = args
@@ -694,7 +694,7 @@ module ActiveRecord
# t.string(:goat)
# t.string(:goat, :sheep)
%w( string text integer float decimal datetime timestamp time date binary boolean ).each do |column_type|
- class_eval <<-EOV
+ class_eval <<-EOV, __FILE__, __LINE__ + 1
def #{column_type}(*args) # def string(*args)
options = args.extract_options! # options = args.extract_options!
column_names = args # column_names = args
diff --git a/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb b/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb
index 470ff8d767..ec25bbf18e 100644
--- a/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb
+++ b/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb
@@ -15,26 +15,26 @@ module MysqlCompat #:nodoc:
# Ruby driver has a version string and returns null values in each_hash
# C driver >= 2.7 returns null values in each_hash
if Mysql.const_defined?(:VERSION) && (Mysql::VERSION.is_a?(String) || Mysql::VERSION >= 20700)
- target.class_eval <<-'end_eval'
- def all_hashes # def all_hashes
- rows = [] # rows = []
- each_hash { |row| rows << row } # each_hash { |row| rows << row }
- rows # rows
- end # end
+ target.class_eval <<-'end_eval', __FILE__, __LINE__ + 1
+ def all_hashes # def all_hashes
+ rows = [] # rows = []
+ each_hash { |row| rows << row } # each_hash { |row| rows << row }
+ rows # rows
+ end # end
end_eval
# adapters before 2.7 don't have a version constant
# and don't return null values in each_hash
else
- target.class_eval <<-'end_eval'
- def all_hashes # def all_hashes
- rows = [] # rows = []
- all_fields = fetch_fields.inject({}) { |fields, f| # all_fields = fetch_fields.inject({}) { |fields, f|
- fields[f.name] = nil; fields # fields[f.name] = nil; fields
- } # }
- each_hash { |row| rows << all_fields.dup.update(row) } # each_hash { |row| rows << all_fields.dup.update(row) }
- rows # rows
- end # end
+ target.class_eval <<-'end_eval', __FILE__, __LINE__ + 1
+ def all_hashes # def all_hashes
+ rows = [] # rows = []
+ all_fields = fetch_fields.inject({}) { |fields, f| # all_fields = fetch_fields.inject({}) { |fields, f|
+ fields[f.name] = nil; fields # fields[f.name] = nil; fields
+ } # }
+ each_hash { |row| rows << all_fields.dup.update(row) } # each_hash { |row| rows << all_fields.dup.update(row) }
+ rows # rows
+ end # end
end_eval
end
diff --git a/activeresource/lib/active_resource/schema.rb b/activeresource/lib/active_resource/schema.rb
index 8368b652c2..5758ac9502 100644
--- a/activeresource/lib/active_resource/schema.rb
+++ b/activeresource/lib/active_resource/schema.rb
@@ -42,7 +42,7 @@ module ActiveResource # :nodoc:
# TODO: We should eventually support all of these:
# %w( string text integer float decimal datetime timestamp time date binary boolean ).each do |attr_type|
KNOWN_ATTRIBUTE_TYPES.each do |attr_type|
- class_eval <<-EOV
+ class_eval <<-EOV, __FILE__, __LINE__ + 1
def #{attr_type.to_s}(*args)
options = args.extract_options!
attr_names = args
diff --git a/activesupport/lib/active_support/core_ext/logger.rb b/activesupport/lib/active_support/core_ext/logger.rb
index 22749229a3..c4994ca2ee 100644
--- a/activesupport/lib/active_support/core_ext/logger.rb
+++ b/activesupport/lib/active_support/core_ext/logger.rb
@@ -3,7 +3,7 @@ require 'active_support/core_ext/class/attribute_accessors'
# Adds the 'around_level' method to Logger.
class Logger #:nodoc:
def self.define_around_helper(level)
- module_eval <<-end_eval
+ module_eval <<-end_eval, __FILE__, __LINE__ + 1
def around_#{level}(before_message, after_message, &block) # def around_debug(before_message, after_message, &block)
self.#{level}(before_message) # self.debug(before_message)
return_value = block.call(self) # return_value = block.call(self)