Commit Graph

41530 Commits

Author SHA1 Message Date
Godfrey Chan
2003d0409e Some assorted fixes for the 4.1 release notes:
* Added release notes for secrets.yml and mentioned it in the highlights
* Added release notes for Mailer previews and mentioned it in the highlights
* Added release notes for Module#concerning
* Removed mention for AV extraction from the highlights
* Rearranged the major features to put highlighted features first
* Various improvements and typo fixes

[ci skip]
2013-12-17 08:39:07 -08:00
Carlos Antonio da Silva
ae196e85ee Merge pull request #13341 from carlosantoniodasilva/ca-i18n
Default I18n.enforce_available_locales to true

We will default this option to true from now on to ensure users properly handle their list of available locales whenever necessary. This option was added as a security measure and thus Rails will follow it defaulting to secure option.

Also improve the handling of I18n config options in its railtie, taking the new enforce_available_locales option into account, by setting it as the last one in the process. This ensures no other configuration will trigger a deprecation warning due to that setting.
2013-12-17 08:22:26 -08:00
Lauro Caetano
d4ee09cda1 Create a blacklist to disallow mutator methods to be delegated to Array.
This change was necessary because the whitelist wouldn't work.
It would be painful for users trying to update their applications.

This blacklist intent to prevent odd bugs and confusion in code that call mutator
methods directely on the `Relation`.
2013-12-17 13:43:10 -02:00
Rafael Mendonça França
5d77edf0cf concern doesn't include the module automatically
[ci skip]
2013-12-17 12:40:44 -02:00
Rafael Mendonça França
c56bbaaf6f Merge pull request #13343 from akshay-vishnoi/test-cases
test case for #limit added - picking latest value from limit
2013-12-17 06:23:05 -08:00
Yves Senn
998550396f release notes link to fixed versions of the API. [ci skip]
As discussed with @fxn the release notes are a snapshot document.
The links going out to the API should represent that exact snapshot.
This means we always link to the full final release. For example
the 3.2 release notes link to http://api.rubyonrails.org/v3.2.0.
2013-12-17 12:19:56 +01:00
Carlos Antonio da Silva
7c858b03a9 Require I18n >= 0.6.9
The option enforce_available_locales is only available on latest
versions, so require the last available one which has the option +
other related fixes and should not have backward compatibility issues.
2013-12-17 09:06:57 -02:00
Carlos Antonio da Silva
8e21ae37ad Add changelog and upgrading notice related to I18n enforce_available_locales handling 2013-12-17 09:06:56 -02:00
Carlos Antonio da Silva
6802196a6b Disable available locales checks to avoid warnings running the tests 2013-12-17 09:05:41 -02:00
Carlos Antonio da Silva
c445c6d1b9 Default I18n.enforce_available_locales to true
We will default this option to true from now on to ensure users properly
handle their list of available locales whenever necessary. This option
was added as a security measure and thus Rails will follow it defaulting
to secure option.

Also improve the handling of I18n config options in its railtie, taking
the new enforce_available_locales option into account, by setting it as
the last one in the process. This ensures no other configuration will
trigger a deprecation warning due to that setting.
2013-12-17 09:05:41 -02:00
Carlos Antonio da Silva
aaa5463cc0 Fix indent on AS changelog [ci skip] 2013-12-17 09:03:12 -02:00
Yves Senn
798da61825 minor doc reword. Upgrade Rails itself not to Rails. [ci skip]
/cc @chancancode
2013-12-17 11:21:11 +01:00
Jeremy Kemper
290368bdb2 Merge pull request #13347 from jeremy/concerning
Introduce Module#concerning
2013-12-17 01:35:50 -08:00
Jeremy Kemper
1eee0ca6de Introduce Module#concerning
A natural, low-ceremony way to separate responsibilities within a class.

Imported from https://github.com/37signals/concerning#readme
2013-12-17 02:31:57 -07:00
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
Akshay Vishnoi
687cd75fb5 test case for #limit added - picking latest value from limit 2013-12-17 03:50:34 +05:30
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
schneems
8d005eb867 [ci skip] add assets.raise_runtime_errors flag
The flag will be used in multiple places to check for errors during runtime if enabled.

Source:  https://github.com/rails/sprockets-rails/pull/100
2013-12-14 12:44:54 -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