Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

gsub("sql", "SQL")

  • Loading branch information...
commit aa4a7a298967f89a5812870962f8c858411eb7ab 1 parent c40c17c
@fxn fxn authored
View
2  activerecord/lib/active_record/associations/has_many_through_association.rb
@@ -34,7 +34,7 @@ def size
def count(*args)
column_name, options = @reflection.klass.send(:construct_count_options_from_args, *args)
if @reflection.options[:uniq]
- # This is needed because 'SELECT count(DISTINCT *)..' is not valid sql statement.
+ # This is needed because 'SELECT count(DISTINCT *)..' is not valid SQL statement.
column_name = "#{@reflection.quoted_table_name}.#{@reflection.klass.primary_key}" if column_name == :all
options.merge!(:distinct => true)
end
View
17 activerecord/lib/active_record/base.rb
@@ -550,8 +550,7 @@ def all(*args)
find(:all, *args)
end
- #
- # Executes a custom sql query against your database and returns all the results. The results will
+ # Executes a custom SQL query against your database and returns all the results. The results will
# be returned as an array with columns requested encapsulated as attributes of the model you call
# this method from. If you call +Product.find_by_sql+ then the results will be returned in a Product
# object with the attributes you specified in the SQL query.
@@ -560,13 +559,13 @@ def all(*args)
# SELECT will be attributes of the model, whether or not they are columns of the corresponding
# table.
#
- # The +sql+ parameter is a full sql query as a string. It will be called as is, there will be
+ # The +sql+ parameter is a full SQL query as a string. It will be called as is, there will be
# no database agnostic conversions performed. This should be a last resort because using, for example,
# MySQL specific terms will lock you to using that particular database engine or require you to
# change your call if you switch engines
#
# ==== Examples
- # # A simple sql query spanning multiple tables
+ # # A simple SQL query spanning multiple tables
# Post.find_by_sql "SELECT p.title, c.author FROM posts p, comments c WHERE p.id = c.post_id"
# > [#<Post:0x36bff9c @attributes={"title"=>"Ruby Meetup", "first_name"=>"Quentin"}>, ...]
#
@@ -1919,7 +1918,7 @@ def class_name_of_active_record_descendant(klass) #:nodoc:
klass.base_class.name
end
- # Accepts an array, hash, or string of sql conditions and sanitizes
+ # Accepts an array, hash, or string of SQL conditions and sanitizes
# them into a valid SQL fragment for a WHERE clause.
# ["name='%s' and group_id='%s'", "foo'bar", 4] returns "name='foo''bar' and group_id='4'"
# { :name => "foo'bar", :group_id => 4 } returns "name='foo''bar' and group_id='4'"
@@ -1935,7 +1934,7 @@ def sanitize_sql_for_conditions(condition)
end
alias_method :sanitize_sql, :sanitize_sql_for_conditions
- # Accepts an array, hash, or string of sql conditions and sanitizes
+ # Accepts an array, hash, or string of SQL conditions and sanitizes
# them into a valid SQL fragment for a SET clause.
# { :name => nil, :group_id => 4 } returns "name = NULL , group_id='4'"
def sanitize_sql_for_assignment(assignments)
@@ -1951,7 +1950,7 @@ def aggregate_mapping(reflection)
mapping.first.is_a?(Array) ? mapping : [mapping]
end
- # Accepts a hash of sql conditions and replaces those attributes
+ # Accepts a hash of SQL conditions and replaces those attributes
# that correspond to a +composed_of+ relationship with their expanded
# aggregate attribute values.
# Given:
@@ -2024,7 +2023,7 @@ def sanitize_sql_hash_for_assignment(attrs)
end
# Accepts an array of conditions. The array has each value
- # sanitized and interpolated into the sql statement.
+ # sanitized and interpolated into the SQL statement.
# ["name='%s' and group_id='%s'", "foo'bar", 4] returns "name='foo''bar' and group_id='4'"
def sanitize_sql_array(ary)
statement, *values = ary
@@ -2575,7 +2574,7 @@ def quote_value(value, column = nil)
self.class.connection.quote(value, column)
end
- # Interpolate custom sql string in instance context.
+ # Interpolate custom SQL string in instance context.
# Optional record argument is meant for custom insert_sql.
def interpolate_sql(sql, record = nil)
instance_eval("%@#{sql.gsub('@', '\@')}@")
View
2  activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
@@ -776,7 +776,7 @@ def distinct(columns, order_by) #:nodoc:
# Returns an ORDER BY clause for the passed order option.
#
# PostgreSQL does not allow arbitrary ordering when using DISTINCT ON, so we work around this
- # by wrapping the sql as a sub-select and ordering in that query.
+ # by wrapping the +sql+ string as a sub-select and ordering in that query.
def add_order_by_for_association_limiting!(sql, options) #:nodoc:
return sql if options[:order].blank?
View
2  railties/configs/databases/oracle.yml
@@ -4,7 +4,7 @@
# http://rubyforge.org/projects/ruby-oci8/
#
# Specify your database using any valid connection syntax, such as a
-# tnsnames.ora service name, or a sql connect url string of the form:
+# tnsnames.ora service name, or a SQL connect url string of the form:
#
# //host:[port][/service name]
#
Please sign in to comment.
Something went wrong with that request. Please try again.