Commit Graph

41877 Commits

Author SHA1 Message Date
aditya-kapoor
fe49f432c9 Adding missing backslashes in active_model files so as to avoid unwanted links in rdoc [ci skip] 2013-12-27 13:58:31 +05:30
Yves Senn
eff8196190 Merge pull request #13500 from arunagw/remove-unused-require
rbconfig is not used in these files remove unused requires
2013-12-26 23:58:58 -08:00
Guillermo Iguaran
7d1d11e620 Merge pull request #13502 from arunagw/bug-report-template-warning
Minitest::Unit::TestCase is Minitest::Test [ci skip]
2013-12-26 14:57:27 -08:00
Arun Agrawal
fd1c515d4d Minitest::Unit::TestCase is Minitest::Test [ci skip] 2013-12-26 23:55:59 +01:00
Arun Agrawal
f593b695fe rbconfig is not used in these files
remove unused requires
2013-12-26 21:18:14 +01:00
Jeremy Kemper
037665cbe1 Merge pull request #13495 from norman/tidy_bytes
Use String#scrub when available to tidy bytes
2013-12-26 12:14:30 -08:00
Arun Agrawal
cef8c8f772 Merge pull request #13498 from dmitrydims/master
Fixed typo in Rails 4.1 Release Notes [CI skip]
2013-12-26 11:43:33 -08:00
Łukasz Strzałkowski
a288cc1e01 Add any/all support for variants
Like `format.any`, you can do the same with variants.

It works for both inline:

    respond_to do |format|
      format.html.any   { render text: "any"   }
      format.html.phone { render text: "phone" }
    end

and block syntax:

    respond_to do |format|
      format.html do |variant|
        variant.any(:tablet, :phablet){ render text: "any" }
        variant.phone { render text: "phone" }
      end
    end
2013-12-26 20:36:17 +01:00
Semenyk Dmitriy
46096a082f Fixed typo [CI skip] 2013-12-27 00:28:47 +05:00
Norman Clarke
ab195841dd Use String#scrub when available to tidy bytes 2013-12-26 12:36:52 -03:00
Xavier Noria
8003c541f7 Merge pull request #13493 from Domon/improve-some-code-font-in-api-doc
Improve font of some code in API documentation [ci skip]
2013-12-26 03:20:19 -08:00
Chun-wei Kuo
fbbd4e1899 Improve font of some code in API documentation [ci skip]
* Add "<tt>" or "+" to improve font of some code and filenames in API documentation
* Does not contain wording changes
2013-12-26 18:54:46 +08:00
Godfrey Chan
87323487ce Merge pull request #13442 from aditya-kapoor/update-docs
Updated documentation for Attribute Methods [ci skip]
2013-12-26 02:02:53 -08:00
Guillermo Iguaran
c99d969160 Merge pull request #13485 from schneems/schneems/fix-more-railties-tests
Partial fix of database url tests
2013-12-25 16:38:49 -08:00
schneems
2409c61661 Fix failure introduced from #13488 2013-12-25 18:45:26 -05:00
schneems
d0926d3d5e fix 2.1.0 bug :( 2013-12-25 18:27:09 -05:00
schneems
707be603cf ensure environment is run before db:structure:load
Right now `db:drop` depends on `load_config` since so when `db:drop` gets executed `load_config` gets run. `db:structure:load` depends on `[:environment, :load_config]`. So before it runs, it executes `environment` but because `load_config` has already executed it is skipped. Note `db:load_config` is "invoke"-d twice, but only "execute"-d once:

```
** Invoke db:drop (first_time)
** Invoke db:load_config (first_time)
** Execute db:load_config
** Execute db:drop
** Invoke db:structure:load (first_time)
** Invoke environment (first_time)
** Execute environment
** Invoke db:load_config
** Execute db:structure:load
```

The fix for this is making sure that the environment is run before any `load_config`:

```
** Invoke environment (first_time)
** Execute environment
** Invoke db:drop (first_time)
** Invoke db:load_config (first_time)
** Execute db:load_config
** Execute db:drop
** Invoke db:structure:load (first_time)
** Invoke environment
** Invoke db:load_config
** Execute db:structure:load
```
2013-12-25 18:03:55 -05:00
schneems
ba882934bb Partial fix of database url tests
Prior to #13463 when `DATABASE_URL` was set, Rails automagically used that value instead of the database.yml. There are tests in dbs_test that expect this to still be true. After that PR, `RAILS_DATABASE_URL` is expected to be read into the YAML file via ERB, this PR fixes that behavior.

Note: this does not entirely fix the tests. It seems that `ActiveRecord::Tasks::DatabaseTasks.current_config` does not process the url string correctly (convert it into a hash), and ` ActiveRecord::Tasks::DatabaseTasks.structure_load(current_config, filename)` as well as other methods in `DatabaseTasks` expect a hash.

It seems like we should involve the resolver somewhere in this process to correctly convert the database url, I do not know the best place for that /cc @josevalim
2013-12-25 18:03:55 -05:00
Guillermo Iguaran
d80ad96b95 Fix tests names: tokens.yml => secrets.yml 2013-12-25 17:34:25 -05:00
Guillermo Iguaran
e9f8fe2707 Merge pull request #13488 from strzalek/fix-railties-warnings
Fix railties warnings
2013-12-25 14:31:29 -08:00
Łukasz Strzałkowski
dd55033777 Cast env to symbol, fixes deprecation warning
Warning:

  DEPRECATION WARNING: Passing a string to ActiveRecord::Base.establish_connection for a configuration lookup is deprecated, please pass a symbol (:development) instead.
2013-12-25 23:26:53 +01:00
Łukasz Strzałkowski
7a9d2925d7 Avoid getting redefined method warning
Warning:

  ~/projects/rails/activerecord/lib/active_record/railtie.rb:140: warning: method redefined; discarding old extend_message
  ~/projects/rails/activerecord/lib/active_record/errors.rb:104: warning: previous definition of extend_message was here
2013-12-25 23:25:53 +01:00
Guillermo Iguaran
278bbfd7df Merge pull request #13478 from schneems/schneems/fix-mysql
Move mysql2 test for when adapter will be loaded
2013-12-25 12:21:38 -08:00
Guillermo Iguaran
2aceccf974 Test with 2.1.0 2013-12-25 15:17:08 -05:00
aditya-kapoor
1dae89ccce Added Backslashes to ActiveModel::AttributeMethods to prevent unwanted links in the rdoc + some other doc fixes.[ci skip] 2013-12-25 18:34:11 +05:30
Arun Agrawal
ed072bd5cb Merge pull request #13482 from aayushkhandelwal11/typo
Typo rectified commom => common[ci skip]
2013-12-25 05:00:24 -08:00
Aayush khandelwal
db7065b53c Typo rectified commom => common[ci skip] 2013-12-25 18:22:26 +05:30
José Valim
84d47d073e Merge pull request #13480 from kuldeepaggarwal/f-removed-depricated-config
using symbol instead of string in establish_connection
2013-12-25 04:48:56 -08:00
Kuldeep Aggarwal
b9d79b1f5f using symbol instead of string in establish_connection 2013-12-25 15:24:25 +05:30
Akira Matsuda
ccc1a7b7b0 Unused classes in AP tests 2013-12-25 18:10:56 +09:00
Akira Matsuda
f57e5f224b Unused class in AV test 2013-12-25 10:33:42 +09:00
schneems
8e2c0803f5 Move mysql2 test for when adapter will be loaded
When run with only the Mysql adapter, we get this failure: https://travis-ci.org/rails/rails/jobs/15937907#L2416

Porting the test over to only run when mysql2 is loaded
2013-12-24 17:28:40 -05:00
José Valim
f89c5f46b5 Revert "Ensure secret_key_base is set for all environments"
A better solution has been pushed to master.

This reverts commit 959cfcef7255bba720ce3f15323056533ea7b50a.
2013-12-24 19:29:31 +01:00
José Valim
db22a5a8eb Merge pull request #13472 from schneems/schneems/fix-master-database-url-tests
Fix railties tests in master
2013-12-24 10:20:51 -08:00
José Valim
df09ce966e Merge pull request #13471 from schneems/schneems/better-secrets-error-message
Better missing `secret_key_base` error message
2013-12-24 08:22:30 -08:00
José Valim
9705df5c2b Merge pull request #13469 from schneems/schneems/no-database-errors-all
Raise NoDatabaseError when db does not exist
2013-12-24 08:17:21 -08:00
schneems
14c175c572 Fix railties tests in master
Tests are failing due to missing env var on master https://travis-ci.org/rails/rails/jobs/15930622#L641

This adds an environment variable `ENV['RAILS_SECRET_KEY_BASE']` so these tests will pass.
2013-12-24 11:13:47 -05:00
schneems
d641a0cf0d Better missing secret_key_base error message
Previously the error was:

```
RuntimeError: You must set secret_key_base in your app's config
```

Will now be:


```
RuntimeError: Missing `secret_key_base` for 'production' environment, set this value in `config/secrets.yml`
```
2013-12-24 11:08:16 -05:00
José Valim
959cfcef72 Ensure secret_key_base is set for all environments 2013-12-24 16:35:43 +01:00
schneems
f0311c2487 Raise NoDatabaseError when db does not exist
Building on the work of #13427 this PR adds a helpful error message to the adapters: mysql, mysql2, and sqlite3
2013-12-24 10:13:12 -05:00
Arun Agrawal
6570448dcd Merge pull request #13467 from JuanitoFatas/getting-started
[ci skip] Update getting started Ruby version.
2013-12-24 04:51:43 -08:00
Juanito Fatas
b58c8d36b7 [ci skip] Update getting started Ruby version. 2013-12-24 20:33:23 +08:00
Robin Dupret
6e2d35df3c Fix few typos and improve markup at some levels 2013-12-24 12:39:41 +01:00
José Valim
ec11807368 Deprecate use of string in establish_connection as connection lookup 2013-12-24 10:18:54 +01:00
José Valim
d2ed433b0a Only build a ConnectionSpecification if required 2013-12-24 10:02:07 +01:00
José Valim
d8336cab32 Fix build failures related to the new ENV options in yml 2013-12-24 09:26:34 +01:00
Akira Matsuda
222f00b422 Unused classes in AV tests 2013-12-24 11:04:49 +09:00
Xavier Noria
fa0380cb4a AC::Parameters#permit! permits hashes in array values 2013-12-23 22:55:03 +01:00
José Valim
33cb2f334d Merge pull request #13463 from josevalim/jv-env
Do not store production information in .yml files
2013-12-23 12:28:04 -08:00
Carlos Antonio da Silva
7530c82e82 Disable locale checks to avoid warnings in Active Model tests [ci skip]
Missed AMo when adding to the other components in
ae196e85ee7169700afac2eecdc276bc06b10b8d.
2013-12-23 17:51:07 -02:00