Skip to content

Commit

Permalink
Remove unused attributes_with_quotes method.
Browse files Browse the repository at this point in the history
  • Loading branch information
miloops committed Mar 25, 2010
1 parent fc2e257 commit d06a754
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions activerecord/lib/active_record/base.rb
Expand Up @@ -2053,26 +2053,6 @@ def attributes_protected_by_default
default
end

# Returns a copy of the attributes hash where all the values have been safely quoted for use in
# an SQL statement.
def attributes_with_quotes(include_primary_key = true, include_readonly_attributes = true, attribute_names = @attributes.keys)
quoted = {}
connection = self.class.connection
attribute_names.each do |name|
if (column = column_for_attribute(name)) && (include_primary_key || !column.primary)
value = read_attribute(name)

# We need explicit to_yaml because quote() does not properly convert Time/Date fields to YAML.
if value && self.class.serialized_attributes.has_key?(name) && (value.acts_like?(:date) || value.acts_like?(:time))
value = value.to_yaml
end

quoted[name] = connection.quote(value, column)
end
end
include_readonly_attributes ? quoted : remove_readonly_attributes(quoted)
end

# Returns a copy of the attributes hash where all the values have been safely quoted for use in
# an Arel insert/update method.
def arel_attributes_values(include_primary_key = true, include_readonly_attributes = true, attribute_names = @attributes.keys)
Expand Down

0 comments on commit d06a754

Please sign in to comment.