Commit Graph

41631 Commits

Author SHA1 Message Date
Rafael Mendonça França
da0463cf5e Improve the tests to not call assert_nothing_raised 2014-01-01 14:15:01 -02:00
Rafael Mendonça França
b94e2dd82c Merge pull request #13550 from vipulnsward/13437-fix
Fix for #13437

Conflicts:
	activerecord/CHANGELOG.md
2014-01-01 14:14:45 -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
Rafael Mendonça França
3e1e36b5ad Merge pull request #13561 from robin850/issue-11723
Avoid raising a NameError on FreeBSD using Date
2014-01-01 06:36:43 -08:00
Robin Dupret
224d3a69ac Merge pull request #13559 from JuanitoFatas/action-controller
[ci skip] Add missing flash message in block filter example.
2014-01-01 06:31:05 -08:00
Robin Dupret
afc98eadb8 Avoid raising a NameError on FreeBSD using Date
The Date object has a xmlschema method starting with Ruby 1.9 so we were
assuming that we could safely remove this method and redefine it later
but the call to remove_method throws a NameError on FreeBSD so we should
rely on remove_possible_method instead.

This call is actually needed to avoid warnings when running the test
suite.

Fixes #11723
2014-01-01 15:29:24 +01: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
Arun Agrawal
97ddfb48db Merge pull request #13558 from bcardarella/bc-fix-example-syntax
Fix comment syntax
2014-01-01 04:47:06 -08:00
Andrew White
b64bac489c Allow engine root relative redirects using an empty string.
Example:

    # application routes.rb
    mount BlogEngine => '/blog'

    # engine routes.rb
    get '/welcome' => redirect('')

This now redirects to the path `/blog`, whereas before it would redirect
to the application root path. In the case of a path redirect or a custom
redirect if the path returned contains a host then the path is treated as
absolute. Similarly for option redirects, if the options hash returned
contains a `:host` or `:domain` key then the path is treated as absolute.

Fixes #7977
2014-01-01 11:19:14 +00:00
Brian Cardarella
9e8592c217 Fix comment syntax
The code syntax in the comment example is invalid
2013-12-31 21:58:04 -05:00
Yasuo Honda
85a1f7ae1e Change the inexistent database name to inexistent_activerecord_unittest
to make this grant statement described in the document works

GRANT ALL PRIVILEGES ON inexistent_activerecord_unittest.* to 'rails'@'localhost';
2014-01-01 09:38:37 +09:00
Yasuo Honda
eb9ced882d Update grant statement to address #13549 2014-01-01 09:25:47 +09:00
Godfrey Chan
0d4614ca21 Merge pull request #13419 from amrnt/nullize-enum
Add the ability to nullize the enum column
2013-12-31 15:53:24 -08:00
Amr Tamimi
e0ad9ae27e Add the ability to nullify the enum column 2014-01-01 01:48:15 +02:00
Rafael Mendonça França
ec46699838 Merge remote-tracking branch 'origin/master' 2013-12-31 21:05:07 -02:00
Rafael Mendonça França
13c18fe2ca Improve tests to use only public API 2013-12-31 21:04:11 -02:00
David Heinemeier Hansson
b5fdeaac55 Merge pull request #13470 from strzalek/variants-all-any
Add any/all support for variants
2013-12-31 09:57:09 -08:00
Vijay Dev
c4fb191a4c Merge branch 'master' of github.com:lifo/docrails 2013-12-31 22:44:34 +05:30
Rafael Mendonça França
b953b2fc46 Merge pull request #13525 from huoxito/make-outer-joins-on-proper-parent
Make outer joins on proper parent
2013-12-31 11:48:35 -02:00
Godfrey Chan
f3a8be3b8b Merge pull request #13131 from gja/changed-accepts-values
Allows you to check if a field has changed to a particular value
2013-12-30 22:05:56 -08:00
Washington Luiz
8e1f26c66c Make outer joins on proper parent
Outer joins were being built on the root relation klass rather than the
one specified in the join dependency root
2013-12-31 01:10:38 -03:00
Rafael Mendonça França
969a0778cd Merge pull request #13541 from schneems/schneems/db-url-sub-key
Allow "url" sub key in database.yml configuration
2013-12-30 19:36:06 -08:00
Vipul A M
bb17c3b210 2075f39d72 introduced a regression in includes/preloades
by calling `read_attribute` on an association when preloading takes places, instead of using loaded records in `association.target`.

tl;dr

Records are not made properly available via `read_attribute` when preloding in simultaneous,
but value of `@loaded` is already set true, and records concatenated in `association.target` on an association object.
When `@loaded` is true we return an object of `AlreadyLoaded` in preload_for. In `AlreadyLoaded` to return preloaded
records we make wrong use of `read_attribute`, instead of `target` records.

The regression is fixed by making use of the loaded records in `association.target` when the preloading takes place.

Fixes #13437
2013-12-31 02:47:37 +05:30
schneems
5b96027ef6 Allow "url" sub key in database.yml configuration
Currently a developer can pass in a YAML configuration that fully specifies connection information:

```
production:
  database: triage_production
  adapter: password
  pool: 5
```

They can also pass in a string that specifies a connection URL directly to an environment key:

```
production: postgresql://localhost/foo
```

This PR allows the use of both a connection url and specifying connection attributes via YAML through the use of the "url" sub key:

```
production:
  url: postgresql://localhost/foo
  pool: 3
```

This will allow developers to inherit Active Record options such as `pool` from `&defaults` and still use a secure connection url such as `<%= ENV['DATABASE_URL'] %>`. The URL is expanded into a hash and then merged back into the YAML hash. If there are any conflicts, the values from the connection URL are preferred. 

Talked this over with @josevalim
2013-12-30 12:21:14 -05:00
Richard Schneeman
16e93561e2 Merge pull request #13536 from schneems/schneems/connection-spec-docs
[ci skip] ConnectionSpecification::Resolver Docs
2013-12-30 07:54:24 -08:00
schneems
8c82ee838e [ci skip] ConnectionSpecification::Resolver Docs
Document the internal interfaces of `ConnectionSpecification::Resolver`

Change method name from `config` to `env` to better match the most common use case.
2013-12-30 10:54:03 -05:00
Xavier Noria
08a87c1e2c Merge pull request #13539 from StevenNunez/patch-1
Update explanation to match example [ci skip]
2013-12-30 07:30:16 -08:00
Steven Nunez
ff47b0518b Update explanation to match example 2013-12-30 09:51:19 -05:00
Yves Senn
2ab3bd16f9 tidy AR CHANGELOG. [ci skip] 2013-12-30 12:18:45 +01:00
Yves Senn
d2aa3324a9 Merge pull request #13538 from robin850/patch-14
Add a missing changelog entry for #13534 [ci skip]
2013-12-30 03:16:02 -08:00
Robin Dupret
ec4b44b1a4 Add a missing changelog entry for #13534 [ci skip] 2013-12-30 12:15:14 +01:00
Piotr Sarnacki
3d865c1bcd Remove deprecation warning for FIXTURES_PATH
FIXTURES_PATH has a bit different case than DatabaseTasks.fixtures_path,
which was added along with deprecation. A use case for FIXTURES_PATH
could be loading fixtures from a different directory just for a given
test run. The implementation is fairly simple, so leaving it as it is
won't hurt.
2013-12-30 09:59:13 +01:00
Piotr Sarnacki
2be2003d06 Revert "Install bundle gems to the system not to vendor/bundle"
This reverts commit 875dd3edfd34eaa20120b6589b0d1905230e948f.

The issue was fixed in rbx-2.2.3
2013-12-30 09:55:28 +01:00
Rafael Mendonça França
4a3e2a0156 Merge pull request #13535 from schneems/schneems/extract-url-logic
Extract db url connection logic to class
2013-12-29 17:23:09 -08:00
schneems
137c0e573b Extract db url connection logic to class 2013-12-29 19:48:51 -05:00
José Valim
10721450de Merge pull request #13527 from kuldeepaggarwal/f-independent-specs
Use user-defined configurations in mysql tests
2013-12-29 12:32:06 -08:00
José Valim
524ad8f572 Merge pull request #13534 from kuldeepaggarwal/f-where-not
raise ArgumentError for nil in .where.not
2013-12-29 12:25:21 -08:00
Kuldeep Aggarwal
a2985e2067 raise ArgumentError exception if Model.where.not is called with nil argument 2013-12-30 01:53:02 +05:30
Andrew White
436ed51711 Fix Encoding::CompatibilityError when public path is UTF-8
In #5337 we forced the path encoding to ASCII-8BIT to prevent static
file handling from blowing up before an application has had chance to
deal with possibly invalid urls. However this has a negative side
effect of making it an incompatible encoding if the application's
public path has UTF-8 characters in it.

To work around the problem we check to see if the path has a valid
encoding once it has been unescaped. If it is not valid then we can
return early since it will not match any file anyway.

Fixes #13518
2013-12-29 18:38:53 +00:00
Andrew White
54ccc58c62 Fix method redefined warning message in mapper.rb 2013-12-29 17:55:54 +00:00
Piotr Sarnacki
15e2eb42a7 Install bundle gems to the system not to vendor/bundle
Rubinius has problems with bundling when shared gems are disabled (ie.
when --path or --deployhment is used). There is no real reason to
install it with --path on TravisCI, so I'm dropping it.
2013-12-29 15:54:51 +01:00
Kuldeep Aggarwal
143da09f51 used user-defined configurations for running tests that might depend on user's system configuration 2013-12-29 13:57:52 +05:30
Xavier Noria
126dc47665 blank? and present? commit to return singletons [Xavier Noria & Pavel Pravosud]
The contract of blank? and present? was in principle to return Object, as we
generally do, the test suite and description was consistent with that, but some
examples had comments like "# => true".

This cannot be unclear, we either fix the examples, or update the contract.

Since users may be already assuming singletons due to the examples and the fact
that they were returned before 30ba7ee, the safest option seems to be to revise
the contract and the implementation of String#blank?

The motivation for 30ba7ee was to improve the performance of the predicate, the
refactor based on === is on par regarding speed.

With this commit we start documenting return types using YARD conventions. We
plan to document return types gradually.
2013-12-28 20:03:38 +01:00
Xavier Noria
7b8944681f Merge pull request #13517 from jetthoughts/13516_blank_to_return_true_false
String#blank? returns True/False
2013-12-28 06:54:16 -08:00
Paul Nikitochkin
37513b10a8 Extracted blank matcher regexp to constant 2013-12-28 16:52:14 +02:00
Yves Senn
f66f483d90 Merge pull request #13514 from kuldeepaggarwal/f-removed-warnings
Removed warnings: setting `changed_attributes` instance variable if it is already initialized.
2013-12-28 04:42:31 -08:00
Kuldeep Aggarwal
e8253d3a64 setting changed_attributes instance variable if it is already initialized. 2013-12-28 17:05:51 +05:30
Arun Agrawal
c60edddc0f Merge pull request #13513 from ilja/master
Typo fix [ci skip]
2013-12-28 02:39:13 -08:00
Ilja Krijger
1196bec8e0 Typo fix [ci skip] 2013-12-28 11:24:01 +01:00
Guillermo Iguaran
04108f214c Merge branch 'master' of github.com:rails/rails 2013-12-27 15:02:57 -05:00