Permalink
Browse files

change 'a SQL' to 'an SQL' as suggested by the api documentation guid…

…elines
  • Loading branch information...
1 parent a316109 commit 1c2a2f711dca8f099d8918e32d8e0b910e623dfa @jaimeiniesta jaimeiniesta committed with fxn Aug 26, 2010
View
@@ -2044,7 +2044,7 @@ during calendar reform. #7649, #7724 [fedot, Geoff Buesing]
end
end
-* Fixed that schema changes while the database was open would break any connections to a SQLite database (now we reconnect if that error is throw) [David Heinemeier Hansson]
+* Fixed that schema changes while the database was open would break any connections to an SQLite database (now we reconnect if that error is throw) [David Heinemeier Hansson]
* Don't classify the has_one class when eager loading, it is already singular. Add tests. (closes #4117) [Jonathan Viney]
@@ -3559,7 +3559,7 @@ in effect. Added :readonly finder constraint. Calling an association collectio
end
end
-* Fixed that schema changes while the database was open would break any connections to a SQLite database (now we reconnect if that error is throw) [David Heinemeier Hansson]
+* Fixed that schema changes while the database was open would break any connections to an SQLite database (now we reconnect if that error is throw) [David Heinemeier Hansson]
* Don't classify the has_one class when eager loading, it is already singular. Add tests. (closes #4117) [Jonathan Viney]
@@ -57,7 +57,7 @@ We can see how it works by looking at some +rails console+ output:
=> false
</shell>
-Creating and saving a new record will send a SQL +INSERT+ operation to the database. Updating an existing record will send a SQL +UPDATE+ operation instead. Validations are typically run before these commands are sent to the database. If any validations fail, the object will be marked as invalid and Active Record will not perform the +INSERT+ or +UPDATE+ operation. This helps to avoid storing an invalid object in the database. You can choose to have specific validations run when an object is created, saved, or updated.
+Creating and saving a new record will send an SQL +INSERT+ operation to the database. Updating an existing record will send an SQL +UPDATE+ operation instead. Validations are typically run before these commands are sent to the database. If any validations fail, the object will be marked as invalid and Active Record will not perform the +INSERT+ or +UPDATE+ operation. This helps to avoid storing an invalid object in the database. You can choose to have specific validations run when an object is created, saved, or updated.
CAUTION: There are many ways to change the state of an object in the database. Some methods will trigger validations, but some will not. This means that it's possible to save an object in the database in an invalid state if you aren't careful.
@@ -382,7 +382,7 @@ class Account < ActiveRecord::Base
end
</ruby>
-The validation happens by performing a SQL query into the model's table, searching for an existing record with the same value in that attribute.
+The validation happens by performing an SQL query into the model's table, searching for an existing record with the same value in that attribute.
There is a +:scope+ option that you can use to specify other attributes that are used to limit the uniqueness check:
@@ -629,7 +629,7 @@ end
h6(#belongs_to-conditions). +:conditions+
-The +:conditions+ option lets you specify the conditions that the associated object must meet (in the syntax used by a SQL +WHERE+ clause).
+The +:conditions+ option lets you specify the conditions that the associated object must meet (in the syntax used by an SQL +WHERE+ clause).
<ruby>
class Order < ActiveRecord::Base
@@ -899,7 +899,7 @@ end
h6(#has_one-conditions). +:conditions+
-The +:conditions+ option lets you specify the conditions that the associated object must meet (in the syntax used by a SQL +WHERE+ clause).
+The +:conditions+ option lets you specify the conditions that the associated object must meet (in the syntax used by an SQL +WHERE+ clause).
<ruby>
class Supplier < ActiveRecord::Base
@@ -961,7 +961,7 @@ end
h6(#has_one-order). +:order+
-The +:order+ option dictates the order in which associated objects will be received (in the syntax used by a SQL +ORDER BY+ clause). Because a +has_one+ association will only retrieve a single associated object, this option should not be needed.
+The +:order+ option dictates the order in which associated objects will be received (in the syntax used by an SQL +ORDER BY+ clause). Because a +has_one+ association will only retrieve a single associated object, this option should not be needed.
h6(#has_one-primary_key). +:primary_key+
@@ -1209,7 +1209,7 @@ end
h6(#has_many-conditions). +:conditions+
-The +:conditions+ option lets you specify the conditions that the associated object must meet (in the syntax used by a SQL +WHERE+ clause).
+The +:conditions+ option lets you specify the conditions that the associated object must meet (in the syntax used by an SQL +WHERE+ clause).
<ruby>
class Customer < ActiveRecord::Base
@@ -1335,7 +1335,7 @@ The +:offset+ option lets you specify the starting offset for fetching objects v
h6(#has_many-order). +:order+
-The +:order+ option dictates the order in which associated objects will be received (in the syntax used by a SQL +ORDER BY+ clause).
+The +:order+ option dictates the order in which associated objects will be received (in the syntax used by an SQL +ORDER BY+ clause).
<ruby>
class Customer < ActiveRecord::Base
@@ -1635,7 +1635,7 @@ end
h6(#has_and_belongs_to_many-conditions). +:conditions+
-The +:conditions+ option lets you specify the conditions that the associated object must meet (in the syntax used by a SQL +WHERE+ clause).
+The +:conditions+ option lets you specify the conditions that the associated object must meet (in the syntax used by an SQL +WHERE+ clause).
<ruby>
class Parts < ActiveRecord::Base
@@ -1724,7 +1724,7 @@ The +:offset+ option lets you specify the starting offset for fetching objects v
h6(#has_and_belongs_to_many-order). +:order+
-The +:order+ option dictates the order in which associated objects will be received (in the syntax used by a SQL +ORDER BY+ clause).
+The +:order+ option dictates the order in which associated objects will be received (in the syntax used by an SQL +ORDER BY+ clause).
<ruby>
class Parts < ActiveRecord::Base
@@ -250,7 +250,7 @@ create_table :products do |t|
end
</ruby>
-By default +create_table+ will create a primary key called +id+. You can change the name of the primary key with the +:primary_key+ option (don't forget to update the corresponding model) or if you don't want a primary key at all (for example for a HABTM join table) you can pass +:id => false+. If you need to pass database specific options you can place a SQL fragment in the +:options+ option. For example
+By default +create_table+ will create a primary key called +id+. You can change the name of the primary key with the +:primary_key+ option (don't forget to update the corresponding model) or if you don't want a primary key at all (for example for a HABTM join table) you can pass +:id => false+. If you need to pass database specific options you can place an SQL fragment in the +:options+ option. For example
<ruby>
create_table :products, :options => "ENGINE=BLACKHOLE" do |t|

14 comments on commit 1c2a2f7

Still reads/sounds pretty strange to me. Why use 'an' with no vowel sound at the beginning of SQL?

Owner

fxn replied Aug 26, 2010

We needed to pick an option for the API style guide and chose "an" because the official pronunciation of "SQL" is /ˌɛskjuːˈɛl/ http://en.wikipedia.org/wiki/SQL

As for "SQLite", we chose also "an" because they use "an" themselves. Respect for other projects' spellings is first. Second, it is a plus that it is coherent with our choice for "SQL".

ngan replied Aug 26, 2010

I always thought "SQL" was an acronym, not an initialism (http://www.lyberty.com/encyc/articles/abbr.html). So I think "a SQL" sounds better, IMHO.

Contributor

ernie replied Aug 26, 2010

Isn't it great, though, that Rails 3 is coming along so nicely that we're spending time debating pronunciation and documentation rather than functionality? :)

guns replied Aug 26, 2010

ngan: It's an acronym if you think SQL is an abbreviation for SEQUEL, the original name for the language, and it's an initialism if you think it stands for Structured Query Language, the commonly accepted backronym. The SQLite author actually pronounces it Es-kyoo-ell-ite, hence `an SQLite database'.

Contributor

norman replied Aug 26, 2010

Both are widely used. The correct choice here is simply to choose one and be consistent, which is exactly what Xavier is doing.

Contributor

dmathieu replied Aug 26, 2010

Next question : should it be singular or plural. After all, there's several SQL(s) requests xD

Contributor

dallas replied Aug 26, 2010

You pluralize the noun, not each adjective leading up to the noun: "some fasts Internets connections".

+1 for an SQL
+1 for not pluralizing SQL

guns replied Aug 26, 2010

dallas: although to be fair, dmathieu is french, et au français, on dit `les connexions rapides'.

But in french you would say "les requêtes SQL" wouldn't you ? no plural on SQL either :)

Contributor

dallas replied Aug 26, 2010

guns: that's a good point—English is a messed up language (but then, so is every language depending on the perspective)

Anyway, +1 for "an SQL" where "SQL" is an initialism for "Structured Query Language" and is pronounced "es•kyoo•ell" (thus beginning with a vowel sound).

Contributor

dmathieu replied Aug 26, 2010

And in french we also say "ironie" which is in fact almost the same than in english ;)

Wow, I didn't mean to start a avalanche here. ( ^ _ ^ ' )

Please sign in to comment.