Commit Graph

49073 Commits

Author SHA1 Message Date
Vipul A M
5cfaf5a46e - Changed IN to ON in markdown renderer condition
- Changed `IN` to `ON` in all note sentences in guides.
2015-01-14 11:52:13 +05:30
Sean Griffin
4d5e660789 Don't attempt to save dirty attributes which are not persistable
This sets a precident for how we handle `attribute` calls, which aren't
backed by a database column. We should not take this as a conscious
decision on how to handle them, and this can change when we make
`attribute` public if we have better ideas in the future.

As the composed attributes API gets fleshed out, I expect the
`persistable_attributes` method to change to
`@attributes.select(&:persistable).keys`, or some more performant
variant there-of. This can probably go away completely once we fully
move dirty checking into the attribute objects once it gets moved up to
Active Model.

Fixes #18407
2015-01-10 12:07:46 -07:00
Yves Senn
89470bbc5e Merge branch 'Prefer-IO_NULL'. Closes #18381. 2015-01-10 15:12:04 +01:00
Nobuyoshi Nakada
69e365d2f4 Use IO::NULL always 2015-01-10 15:11:05 +01:00
Yves Senn
e47d6a31a5 Merge pull request #18433 from koraktor/patch-1
Fix typo in PostresSQLAdapter's documentation [ci skip]
2015-01-10 13:49:34 +01:00
Sebastian Staudt
a4139a1674 Fix typo in PostresSQLAdapter's documentation 2015-01-10 13:15:03 +01:00
Yves Senn
a7621d7d53 formatting pass over CHANGELOGs. [ci skip] 2015-01-10 12:17:57 +01:00
Carlos Antonio da Silva
ea1d3d98b1 Remove note about supported plugins from the releasing docs
The last supported plugin on the list was protected_attributes, which is
not going to be supported anymore on Rails 5.

[ci skip]
2015-01-09 22:42:29 -02:00
Carlos Antonio da Silva
f4fbc03010 Remove support for the protected attributes gem
Related to #10690.
2015-01-09 22:42:29 -02:00
Guillermo Iguaran
d8b8a726e7 Merge pull request #18347 from robertomiranda/has_secure_token_base62
Switching SecureTokens to Base58
2015-01-09 18:50:48 -05:00
robertomiranda
47316feee0 Switch Secure Token generation to Base58
Update Secure Token Doc [ci skip]

remove require securerandom, core_ext/securerandom already do that ref 7e006057
2015-01-09 18:47:44 -05:00
Guillermo Iguaran
6907fcd8c7 Merge pull request #10690 from robertomiranda/remove_mass_assignment_security
Remove attributes_protected_by_default reference
2015-01-09 18:33:44 -05:00
Guillermo Iguaran
7e006057e0 Add missing require 2015-01-09 18:24:54 -05:00
robertomiranda
e0213f45ea Remove attributes_protected_by_default reference, since MassAssignmentSecurity was removed from ActiveModel f8c9a4d3e88181 2015-01-09 17:53:54 -05:00
Guillermo Iguaran
b109397711 Add SecureRandom.base58 2015-01-09 17:51:46 -05:00
Godfrey Chan
82dd93bd5e Merge pull request #18426 from arthurnn/txn_ref
Copy records to parent transaction should happen on TransactionManager
2015-01-09 14:07:25 -08:00
Arthur Neves
86a853e4ec Copy records to parent transaction should happen on TransactionManager
It is up to the TransactionManager keep the state of current transaction, so after it commits it needs to copy any remaning record to the next current transaction
2015-01-09 15:54:20 -05:00
Rafael Mendonça França
4e48873a92 Merge pull request #18425 from arthurnn/kargs_transaction
Use keyword args on committed! and rolledback!
2015-01-09 18:52:44 -02:00
Arthur Neves
c7f56d99e5 Use keyword args on committed! and rolledback!
As discussed before, those methods should receive a keyword args instead of just parameters
2015-01-09 15:35:51 -05:00
Sean Griffin
ec475547a9 Properly copy nested bind values from subqueried relations
This is cropping up all over the place. After a brief dive, I'm really
not sure why we have `arel.bind_values` at all. A cursory grep didn't
reveal where they're actually being assigned (it's definitely in AR, not
in Arel). I'd like to dig further into it, as I'm fairly certain we
don't actually need it, we just need a way for the predicate builder to
communicate merged binds upstream.

Fixes #18414
2015-01-09 10:31:23 -07:00
Sean Griffin
13772bfa49 Properly persist lock_version as 0 if the DB has no default
The reason this bug occured is that we never actually check to see if
this column has changed from it's default, since it was never assigned
and is not mutable.

It appears I was wrong in b301c40224c6d15b539dbcc7485adb44d810f88c, with
my statement of "there is no longer a case where a given value would
differ from the default, but would not already be marked as changed."

However, I chose not to revert the deletion of
`initialize_internals_callback` from that commit, as I think a solution
closer to where the problem lies is less likely to get erroneously
removed. I'm not super happy with this solution, but it mirrors what is
being done in `_update_record`, and a fix for one should work for the
other.

I toyed with the idea of changing the definition of `changed?` on the
type to `changed_in_place?`. If we type cast the raw value, it'll break
a test about updating not modifying the lock column if nothing else was
changed. We could have the definition check if `raw_old_value` is `nil`,
but this feels fragile and less intention revealing. It would, however,
have the benefit of cleaning up old data that incorrectly persisted as
`nil`.

Fixes #18422
2015-01-09 09:56:15 -07:00
Rafael Mendonça França
c425d66424 Merge pull request #18390 from tgxworld/parallel_bundle_install
Use parallel bundler install.
2015-01-09 14:40:29 -02:00
David Heinemeier Hansson
6eb499f600 Merge pull request #18413 from brainopia/automatic_inverse_of_for_belongs_to
Correctly count methods when using declarative `#test` in minitest
2015-01-09 11:22:07 -05:00
Guo Xiang Tan
be6874fb63 Use parallel bundler install.
Travis recommends a default of 3.
See: http://docs.travis-ci.com/user/languages/ruby/#Default-Test-Script
2015-01-10 00:03:39 +08:00
Yves Senn
a94f8e71d2 Merge pull request #18423 from jone/remove-default-header
Default headers, removed in controller actions, will not be reapplied to the test response
2015-01-09 17:01:31 +01:00
Jonas Baumann
0739480f45 Default headers, removed in controller actions, will not be reapplied to the test response. 2015-01-09 16:55:02 +01:00
Rafael Mendonça França
6f9eab9ebe Merge pull request #18416 from caike/master
Add _mailer suffix to i18n path
2015-01-09 13:11:51 -02:00
Sean Griffin
924ef1c79a Merge pull request #18417 from yoshiokatsuneo/active_record_connection_pool_error_disconnect
ActiveRecord: release connection on reconnect failure.
2015-01-09 06:06:22 -07:00
brainopia
700f3b7e26 Drop old test locations from rake stats
- test/functional
- test/unit
2015-01-09 12:54:11 +03:00
brainopia
37704547d9 Update rake counts to count declarative tests in minitest 2015-01-09 12:52:23 +03:00
Yoshioka Tsuneo
205a561e50 ActiveRecord: release connection on reconnect failure.
When trying to checkout connection from connection pool,
checkout()(and checkout_and_verify) verify whether the connection
is active or not.
And, if the connection is not active, connection adapters try to
reconnect to server.  And, if database is down at this moment,
reconnect fails and exception is raised.
(Ex: Mysql2::Error: Can't connect to local MySQL server through socket xxx)

But, ConnectionPool does not catch the exception, but leaks current
disconnected connection to @connection.
So, if database's temporary down happens several times and exceeds
the number of connection pool(5 by default), activerecord will be
no more available, even if database server is already recovered.

This patch fix it by catching exception and releasing connection.
2015-01-09 14:33:17 +09:00
Carlos Souza
6870d48d19 Add _mailer suffix to i18n path
For mailers created via generators

Follow up to #18074
2015-01-08 22:24:22 -05:00
Rafael Mendonça França
a74041d483 Merge pull request #18410 from seuros/ripfilter
remove *_filter
2015-01-08 18:55:27 -02:00
Abdelkader Boudih
7644a99d90 Deprecate all *_filter callbacks in favor of *_action callbacks 2015-01-08 20:52:36 +00:00
Rafael Mendonça França
b8e83ce1c5 Merge pull request #18404 from claudiob/rebase-14549
Add test case and documentation for skip_before_filter.
2015-01-08 18:08:02 -02:00
David Heinemeier Hansson
9af5f33a16 Fix the example (for realz) 2015-01-08 11:18:06 -08:00
David Heinemeier Hansson
6b9a973154 Fix the example 2015-01-08 11:17:03 -08:00
David Heinemeier Hansson
4dcfc1f17a Merge pull request #18334 from simi/prepend-false-for-protect-from-forgery
Add prepend option to protect_from_forgery.
2015-01-08 10:51:16 -08:00
Josef Šimánek
0074bbb07b Add prepend option to protect_from_forgery. 2015-01-08 19:47:19 +01:00
David Heinemeier Hansson
46c853f31e Merge pull request #18371 from brainopia/remove_hide_actions
Remove ActionController::HideActions (closes #18336)
2015-01-08 10:28:25 -08:00
Caleb Thompson
17136c2013 Document has_many :extend option
5937bd02de (commitcomment-9205786)
2015-01-08 12:20:37 -06:00
claudiob
9a25603d0a Add test/doc for :if/:except in skip_before_action
The new test/docs further explain the conflicts that can happen when
mixing `:if`/`:unless` options with `:only`/`:except` options in
`skip_before_action`.

The gist is that "positive" filters always have priority over negative
ones.

The previous commit already showed that `:only` has priority over `:if`.

This commit shows that `:if` has priority over `:except`.

For instance, the following snippets are equivalent:

```ruby
skip_before_action :some_callback, if: -> { condition }, except: action
```

```ruby
skip_before_action :some_callback, if: -> { condition }
```
2015-01-08 09:30:31 -08:00
Lauro Caetano
ae9f803c5d Add test case and documentation for skip_before_filter.
Test case for using skip_before_filter with the options :only and :if
both present. In this case, the :if option will be ignored and :only
will be executed.

Closes #14549 (the commit was cherry-picked from there).
2015-01-08 09:13:45 -08:00
David Heinemeier Hansson
0e8c7ff7f7 Merge pull request #18403 from georgeclaghorn/enqueued-email-assertions
Enqueued email assertions
2015-01-08 07:15:39 -08:00
George Claghorn
3f17fbd68d Add assert_enqueued_emails and assert_no_enqueued_emails 2015-01-08 09:41:22 -05:00
George Claghorn
91e31e82fe Add :only option to assert_no_enqueued_jobs 2015-01-08 09:39:01 -05:00
Carlos Antonio da Silva
a22a653c29 Fix Active Job changelog formatting and reword a bit [ci skip] 2015-01-08 07:40:00 -02:00
David Heinemeier Hansson
e54719df66 Merge pull request #18397 from georgeclaghorn/enhance-job-assertions
Add :only option to assert_enqueued_jobs
2015-01-07 21:07:17 -08:00
George Claghorn
b5e88317cc Add :only option to assert_enqueued_jobs
With the option, assert_enqueued_jobs will check the number of times a specific kind of job is enqueued.
2015-01-07 23:44:08 -05:00
Godfrey Chan
f6b21d48ef Merge pull request #16640 from mfazekas/fix_loop_in_changed_for_autosave
Fix potenital infinite recursion in changed_for_autosave?
2015-01-07 15:56:50 -08:00