Commit Graph

2136 Commits

Author SHA1 Message Date
John Olmsted & Strand McCutchen
098a960266 Reordered classes in AR Validation #validates_with example [ci skip]
Person called GoodnessValidator before it was defined.
This change will compile the example correctly.
2014-01-24 11:30:07 -08:00
Yves Senn
75cd7bc3c2 Merge pull request #13728 from semenyukdmitriy/master
Added missing `file` delivery method to the Configuration Guide
2014-01-22 01:53:30 -08:00
Semenyuk Dmitriy
9e63ead4ae [ci skip] Added missing file delivery method 2014-01-22 15:50:01 +06:00
Yves Senn
080fc9cad3 docs should say email not Email. [ci skip] 2014-01-20 15:04:36 +01:00
Yves Senn
dfac4ced1d docs, hyperlink the Mail gem in Action Mailer guide. [ci skip] 2014-01-20 14:47:40 +01:00
Yves Senn
079ffc96c1 let's link to the gem README not to the upgrading guide. [ci skip]
The PR #13767 added link to the upgrading guide to explain
details about activerecord_deprecated-finders. However the link target
features a stack of changes not releated at all. Also the relevant details
are not very informative.

I think we better link to the README so people can see what the gem is about
and how to use it.

/cc @chancancode @zzak
2014-01-20 14:06:37 +01:00
Godfrey Chan
06849fd4d0 Merge pull request #13767 from zzak/doc_4_1_release_notes_deprecated_finders
Add link to upgrade guide for full list of deprecated finders [ci skip]
2014-01-20 02:03:58 -08:00
Arel English
7f255245bd Fix a typo that says you application [ci skip] 2014-01-20 00:37:48 -05:00
Rajesh Thummalapally
610a3e8bdb Correcting link that is pointing to Rails blog [ci skip] 2014-01-19 23:47:48 -05:00
Zachary Scott
9040e04c72 Add link to upgrade guide for full list of deprecated finders [ci skip] 2014-01-19 18:43:51 -08:00
Rashmi Yadav
b20d4453dd Spring in now under rails/spring [ci skip] 2014-01-19 10:52:49 +01:00
Charlie Jade
bf89bfdc34 Correct the version number to 4 in guides[ci skip] 2014-01-18 12:14:21 +08:00
Rafael Mendonça França
7252b43c6e Only some dynamic finders are deprecated.
find_by_* and find_by_*! are not deprecated for example, so lets add a
note only where it is needed

[ci skip]
2014-01-16 22:12:37 -02:00
Rex Feng
beeb8969e0 clean up security guide: his => their [ci skip] 2014-01-16 18:57:21 -05:00
Chulki Lee
1ab6c656d6 Use single quotes in generated files 2014-01-14 11:13:42 -08:00
Carlos Antonio da Silva
028029c1b6 Merge pull request #13705 from mess110/controller_generator_route_quotes
Single quotes for controller generated routes. This is more consistent with all other Rails generated code.
2014-01-14 02:13:28 -08:00
Yves Senn
c2a6fc42d2 Merge pull request #13706 from prathamesh-sonpatki/issue-13125
Fix fields_for documentation with index option [ci skip]
2014-01-14 01:16:34 -08:00
Prathamesh Sonpatki
3cf5d2b75b Fix fields_for documentation with index option [ci skip]
- fields_for documentation with index option was wrong.
- It does not work with passing model as it is.
- Changed the example by passing id of the address object.
- Fixes #13125.
2014-01-14 14:38:07 +05:30
Cristian Mircea Messel
9cdc7c0614 single quotes for controller generated routes
Write routes in route.rb with single quotes

    get 'welcome/index'

instead of

    get "welcome/index"
2014-01-14 09:31:51 +02:00
Uday Kadaboina
ad04c2e0b5 [ci skip] Added alias to CSRF 2014-01-14 01:31:23 -05:00
Xavier Noria
e992cd4d91 updates screenshot data [ci skip] 2014-01-13 23:32:04 +01:00
Xavier Noria
7524a9166c revises a few things in the getting started guide [ci skip]
More to come.
2014-01-13 23:11:44 +01:00
Rystraum Gamonez
25a9623422 Updated Changelog to reflect removal of :dependent => :restrict
Based on https://github.com/rails/rails/issues/2502, the option has
been removed.
2014-01-14 01:29:26 +08:00
Xavier Noria
6049249c6c upgrade SDoc
Kudos to @zzak for taking over SDoc and make it work with RDoc 4.
2014-01-12 22:18:44 +01:00
leriksen
951bb848be [ci skip] - error_messages_for has been deprecated since 2.3.8 - lets reduce any confusion for users 2014-01-10 12:08:17 +11:00
Rafael Mendonça França
8a5b480ebb Merge pull request #13582 from schneems/schneems/preserve-connection-behavior
Ensure Active Record connection consistency
2014-01-09 14:37:51 -08:00
schneems
6cc03675d3 Ensure Active Record connection consistency
Currently Active Record can be configured via the environment variable `DATABASE_URL` or by manually injecting a hash of values which is what Rails does, reading in `database.yml` and setting Active Record appropriately. Active Record expects to be able to use `DATABASE_URL` without the use of Rails, and we cannot rip out this functionality without deprecating. This presents a problem though when both config is set, and a `DATABASE_URL` is present. Currently the `DATABASE_URL` should "win" and none of the values in `database.yml` are used. This is somewhat unexpected to me if I were to set values such as `pool` in the `production:` group of `database.yml` they are ignored.

There are many ways that active record initiates a connection today:

- Stand Alone (without rails)
  - `rake db:<tasks>`
  - ActiveRecord.establish_connection
 
- With Rails
  - `rake db:<tasks>`
  - `rails <server> | <console>`
  - `rails dbconsole`


We should make all of these behave exactly the same way. The best way to do this is to put all of this logic in one place so it is guaranteed to be used.

Here is my prosed matrix of how this behavior should work:

```
No database.yml
No DATABASE_URL
=> Error
```

```
database.yml present
No DATABASE_URL
=> Use database.yml configuration
```

```
No database.yml
DATABASE_URL present
=> use DATABASE_URL configuration
```

```
database.yml present
DATABASE_URL present
=> Merged into `url` sub key. If both specify `url` sub key, the `database.yml` `url`
   sub key "wins". If other paramaters `adapter` or `database` are specified in YAML,
   they are discarded as the `url` sub key "wins".
```

### Implementation

Current implementation uses `ActiveRecord::Base.configurations` to resolve and merge all connection information before returning. This is achieved through a utility class: `ActiveRecord::ConnectionHandling::MergeAndResolveDefaultUrlConfig`.

To understand the exact behavior of this class, it is best to review the behavior in activerecord/test/cases/connection_adapters/connection_handler_test.rb though it should match the above proposal.
2014-01-09 16:35:37 -06:00
Rafael Mendonça França
a67f25d50b Merge pull request #13632 from tinogomes/master
Adding Hash#compact and Hash#compact! methods
2014-01-09 10:14:25 -08:00
tinogomes
5121593787 Adding Hash#compact and Hash#compact! methods
* Adding Hash#compact and Hash#compact! methods
  * Using Ruby 1.9 syntax on documentation
  * Updating guides for `Hash#compact` and `Hash#compact!` methods
  * Updating CHANGELOG for ActiveSupport
  * Removing unecessary protected method and lambda for `Hash#compact` implementations
  * Performing `Hash#compact` implementation - https://gist.github.com/tinogomes/8332883
  * fixing order position
  * Fixing typo
2014-01-09 16:02:55 -02:00
Jake Worth
de535226e8 Fix typo [ci skip] 2014-01-08 13:47:20 -06:00
Damien Mathieu
a334425caf create/drop test and development databases only if RAILS_ENV is nil
Closes #13625
2014-01-08 14:37:07 +01:00
Yves Senn
2229c523aa update 4.1 release notes with deprecation commit link. [ci skip] 2014-01-06 10:00:40 +01:00
Soon Van
44473e49a8 Ruby is a proper noun here, not part of code fragment [ci skip]
Last line of note also relates heavily to first part
and parenthesis broke reading flow.
2014-01-05 18:42:14 -05:00
Andrew White
3a48b83e5e Allow an absolute controller path inside a module scope
Fixes #12777
2014-01-05 19:58:04 +00:00
T.J. Schuck
72bb3fc297 Change all "can not"s to the correct "cannot". 2014-01-03 17:02:31 -05:00
Yves Senn
97e7ca48c1 Deprecate unused symbolized_base_class and symbolized_sti_name.
These methods were only used for the `IdentityMap` which was removed.
They are no longer used internally and should be removed without replacement.

As they were not `:nodoc:`'ed it's better to deprecate them before removal.
2014-01-03 16:31:20 +01:00
Jon Leighton
ff7ab3bc78 Automatically maintain test database schema
* Move check from generated helper to test_help.rb, so that all
  applications can benefit
* Rather than just raising when the test schema has pending migrations,
  try to load in the schema and only raise if there are pending
  migrations afterwards
* Opt out of the check by setting
  config.active_record.maintain_test_schema = false
* Deprecate db:test:* tasks. The test helper is now fully responsible
  for maintaining the test schema, so we don't need rake tasks for this.
  This is also a speed improvement since we're no longer reloading the
  test database on every call to "rake test".
2014-01-02 13:49:00 +00:00
Mo Omer
6fc59d38d8 Removed elipsis indicating that the reader should have more code than what is pasted.
[ci skip]
2014-01-01 19:00:57 -02:00
Rafael Mendonça França
0b4905d0d5 Make explicit that the view file need to be created [ci skip]
Closes #13566
2014-01-01 18:57:18 -02:00
Rafael Mendonça França
a7094f5c88 Do not highlight rake routes output as ruby code [ci skip]
Closes #13565
2014-01-01 18:54:55 -02:00
Rafael Mendonça França
e015f4e2e3 Merge pull request #13556 from yahonda/update_mysql_grant
Update grant statement to address #13549
2014-01-01 07:38:15 -08:00
Juanito Fatas
aa22ab8ce1 [ci skip] Add missing flash message in block filter example.
Also make all three examples consistent.
2014-01-01 21:49:40 +08:00
Yasuo Honda
eb9ced882d Update grant statement to address #13549 2014-01-01 09:25:47 +09:00
Vijay Dev
c4fb191a4c Merge branch 'master' of github.com:lifo/docrails 2013-12-31 22:44:34 +05:30
Steven Nunez
ff47b0518b Update explanation to match example 2013-12-30 09:51:19 -05:00
Ilja Krijger
1196bec8e0 Typo fix [ci skip] 2013-12-28 11:24:01 +01:00
Robin Dupret
a9444916ee Ensure backward compatibility between Minitest 5 and 4
Define Minitest::Test in case we are running the gist under Minitest 4
and avoid relying on MiniTest::Unit::TestCase to avoid displaying
warning on version five.

[ci skip]
2013-12-27 11:30:53 +01:00
Yves Senn
aabfba7aa0 doc fix. Use sess.path within open_session. Closes #13490. [ci skip] 2013-12-27 09:35:14 +01:00
Arun Agrawal
fd1c515d4d Minitest::Unit::TestCase is Minitest::Test [ci skip] 2013-12-26 23:55:59 +01:00
Semenyk Dmitriy
46096a082f Fixed typo [CI skip] 2013-12-27 00:28:47 +05:00