Commit Graph

41350 Commits

Author SHA1 Message Date
Jeremy Kemper
c28d0f2031 MySQL: remove the old-school 'packets out of order' message
Blast from the past, MySQL 4 era, when the password hashing style changed.
2013-12-17 01:56:42 -07:00
Yves Senn
eeda62eac4 use bin/spring in release notes. [ci skip]
Follow up to: 828a8f2145 (commitcomment-4879462)

This will be available after c6e25804b3
is released.
2013-12-17 09:43:19 +01:00
Guillermo Iguaran
666d945064 Merge pull request #13332 from rails/pixeltrix/mail_view
WIP: Integration of mail_view gem
2013-12-16 21:19:39 -08:00
Andrew White
d6dec7fcb6 Add mailer previews feature based on mail_view gem 2013-12-17 03:58:35 +00:00
Andrew White
1602a70fb4 Add an application controller for internal controllers 2013-12-17 03:58:35 +00:00
Andrew White
9d9f4dac06 Fix method redefinition warning 2013-12-17 03:58:34 +00:00
Carlos Antonio da Silva
a6f88d0924 Merge pull request #12873 from martinemde/fix-where-assoc-nil
Better support for AR:B.where(belongs_to_assoc: val) which previously generated invalid SQL
2013-12-16 15:46:56 -08:00
Martin Emde
8062a30794 Better support for where() conditions that use an association name.
Using the name of an association in `where` previously worked only
if the value was a single `ActiveRecrd::Base` object. e.g.

    Post.where(author: Author.first)

Any other values, including `nil`, would cause invalid SQL to be
generated. This change supports arguments in the `where` query
conditions where the key is a `belongs_to` association name and the
value is `nil`, an `Array` of `ActiveRecord::Base` objects, or an
`ActiveRecord::Relation` object.

    # Given the Post model
    class Post < ActiveRecord::Base
      belongs_to :author
    end

    # nil value finds records where the association is not set
    Post.where(author: nil)
    # SELECT "posts".* FROM "posts" WHERE "posts"."author_id" IS NULL

    # Array values find records where the association foreign key
    # matches the ids of the passed ActiveRecord models, resulting
    # in the same query as Post.where(author_id: [1,2])
    authors_array = [Author.find(1), Author.find(2)]
    Post.where(author: authors_array)

    # ActiveRecord::Relation values find records using the same
    # query as Post.where(author_id: Author.where(last_name: "Emde"))
    Post.where(author: Author.where(last_name: "Emde"))

Polymorphic `belongs_to` associations will continue to be handled
appropriately, with the polymorphic `association_type` field added
to the query to match the base class of the value. This feature
previously only worked when the value was a single `ActveRecord::Base`.

    class Post < ActiveRecord::Base
      belongs_to :author, polymorphic: true
    end

    Post.where(author: Author.where(last_name: "Emde"))
    # Generates a query similar to:
    Post.where(author_id: Author.where(last_name: "Emde"), author_type: "Author")
2013-12-16 14:16:15 -08:00
Rafael Mendonça França
0dea33f770 Remove the link for code.whytheluckystiff.net
This is not a valid URL.

[ci skip]
2013-12-16 16:57:35 -02:00
Rafael Mendonça França
4451132229 Merge pull request #13338 from shreve/patch-1
Fix url leak in application templates guide
2013-12-16 10:45:25 -08:00
Jacob Evan Shreve
80dbcf629c Fix url leak in application templates guide
Encapsulate url that was including the trailing quote and colon.
2013-12-16 13:43:50 -05:00
Jeremy Kemper
e7b8769cbc Merge pull request #13321 from mezis/fix-safebuffer-interpolation-master
Fixes interpolation on SafeBuffer
2013-12-16 06:54:48 -08:00
Carlos Antonio da Silva
4b4aeabb36 Fix missing closing rdoc tag [ci skip] 2013-12-16 11:14:54 -02:00
Yves Senn
bd66532ae4 Merge pull request #13328 from teohm/dbconsole_support_database_url
Fixed rails dbconsole to support DATABASE_URL
2013-12-16 02:37:01 -08:00
Huiming Teo
971d5107cd fixed rails dbconsole to support ENV['DATABASE_URL']. 2013-12-16 18:31:49 +08:00
Yves Senn
dfbea4db54 Merge pull request #13333 from kia84/master
Added `absence` parameter to pluralization table [ci skip]
2013-12-15 23:38:27 -08:00
Ivan
e838fa068f Added absence parameter to pluralization table
Added `absence` parameter to table in section `5.1.2 Error Message Interpolation`.
2013-12-16 10:13:35 +03:00
Rafael Mendonça França
108171a44e Merge pull request #13307 from akshay-vishnoi/typo
Spelling and Grammar check [ci skip]
2013-12-15 11:19:44 -08:00
Akshay Vishnoi
c758093eca Spelling and Grammar check [ci skip] 2013-12-16 00:44:37 +05:30
Rafael Mendonça França
89c46aaaab Improve CHANGELOG entry with examples [ci skip] 2013-12-15 17:07:44 -02:00
Rafael Mendonça França
a09659d59d Merge pull request #13313 from ccutrer/temp-tables
support creating temporary tables from queries

Conflicts:
	activerecord/CHANGELOG.md
2013-12-15 17:07:31 -02:00
Rafael Mendonça França
d150387a38 Improve the CHANGELOG entry [ci skip] 2013-12-15 16:46:12 -02:00
Rafael Mendonça França
b0e06ec0da Merge pull request #13312 from arthurnn/fix_db_task_req
db:test:clone and prepare must load environment
2013-12-15 10:45:03 -08:00
Guillermo Iguaran
0e5ef3f3ec Merge pull request #13329 from robertomiranda/secret-token-docs
[ci-skip] Update secret_key_base Docs
2013-12-15 07:48:13 -08:00
robertomiranda
35d0d6fec5 Update secret_key_base Docs 2013-12-15 10:32:41 -05:00
Arthur Neves
2648819ef1 Regression test for load_structure and clone_structure 2013-12-14 18:00:17 -05:00
Arthur Neves
b3a806b7b2 db:test:clone and prepare must load environment
db:test:clone and db:test:prepare use
ActiveRecord::Base. configurations, so we need to load the rails
environment, otherwise the config wont be in place.
2013-12-14 17:33:50 -05:00
Robin Dupret
fc83efae51 Merge pull request #13181 from fluxusfrequency/patch-4
Clarification, grammar fixes, punctuation, and capitalization [ci skip]
2013-12-14 13:33:17 -08:00
Ben Lewis
f95d78e402 Word wrapping engines guide [ci skip] 2013-12-14 13:28:08 -07:00
Ben Lewis
39eb10c3b5 Clarification, grammar fixes, punctuation, and capitalization [ci skip] 2013-12-14 13:27:45 -07:00
Guillermo Iguaran
badcd7bb00 Merge pull request #13325 from kuldeepaggarwal/docs-update
Improved documents [ci skip]
2013-12-14 09:40:11 -08:00
Kuldeep Aggarwal
e10f91000b Improved documents [ci skip] 2013-12-14 22:49:00 +05:30
Rafael Mendonça França
068237d02f Merge pull request #13324 from fphilipe/fix-syntax-error-in-example
Fix syntax error in redirect_to example
2013-12-14 07:18:20 -08:00
Philipe Fatio
fd76b9d546 Fix syntax error in redirect_to example
Without parenthesis, ruby assumes that curly braces denote the beginning
of a block.
2013-12-14 15:35:50 +01:00
Cody Cutrer
75a2e4a8df support creating temporary tables from queries
also override drop_table in AbstractMySQLAdapter to properly drop
temporary tables without committing the transaction
2013-12-14 07:07:10 -07:00
Godfrey Chan
068580d445 Merge pull request #13316 from JuanitoFatas/working-with-js
Improve document: working with javascript in rails [ci skip].
2013-12-14 03:30:29 -08:00
Juanito Fatas
02caba2b86 Improve document: working with javascript in rails [ci skip].
* Add form_tag generated output.
* improve some text.
* data-remote='true' should use double quotes.
2013-12-14 19:22:04 +08:00
Julien Letessier
a764938ad0 Fixes interpolation on SafeBuffer
Interpolation was untested and did not work with hash arguments.

Adds
- support for interpolation with hash argument
- tests for the above
- tests for safe/unsafe interpolation
2013-12-14 10:10:47 +00:00
Rafael Mendonça França
12affbe491 Fix typo [ci skip] 2013-12-13 18:33:30 -02:00
Guillermo Iguaran
eed8c85f4b Merge pull request #13298 from rails/secret_tokens
Create config/secrets.yml file for store of tokens
2013-12-13 09:48:34 -08:00
Guillermo Iguaran
c1f4bc2628 Add comment about secret_key_base in secrets.yml 2013-12-13 12:47:37 -05:00
Rafael Mendonça França
92b92f1782 Merge pull request #13309 from arunagw/warning-fix-argumnet
argument prefix warning removed
2013-12-13 08:24:45 -08:00
Arun Agrawal
c2f1796c6d argument prefix warning removed
* interpreted as a argument prefix
2013-12-13 17:19:20 +01:00
Rafael Mendonça França
1713e8fe16 Merge pull request #13306 from kassio/master
Fix mysql to support duplicated column names
2013-12-13 05:55:54 -08:00
Kassio Borges
b8569b9337 Fix mysql to support duplicated column names
This will fix the [broken
test](4a26508366)
 `test_with_limiting_with_custom_select`.

The query's result was built in a hash with column name as key, if the
result have a duplicated column name the last value was
overriding the first one.
2013-12-13 11:55:13 -02:00
Yves Senn
63f9a7507b refactor, reuse assertions in range_test.rb. 2013-12-13 14:28:13 +01:00
Yves Senn
c4044b2f8a extract PG range tests from datatype_test.rb into range_test.rb 2013-12-13 14:17:21 +01:00
Yves Senn
7ce846c177 Merge pull request #13305 from psahni/form_tag_with_parameters
form_tag with parameters fixed [ci skip]
2013-12-13 00:59:46 -08:00
Prashant Sahni
330883196b form_tag with parameters fixed [ ci skip ] 2013-12-13 14:03:44 +05:30
Arun Agrawal
9b8f7e0303 Merge pull request #13303 from dvsuresh/typo_postgresqlyml
Correct comment in databases/postgresql.yml [ci skip]
2013-12-12 22:00:50 -08:00