add the missing middleware in command line guides rake about [ci skip]
Merge pull request #11566 from rajcybage/master

add the missing middleware in command line guides rake about [ci skip]
extract mutation from generation method
factory methods should not have side effects.

Move model mutation to the methods that are called on the model.
Use GeneratedAttribute#column_name if #reference? scaffold_generator in _form view [Fixes #11573]
add a specific factory method rather than using new
stop relying on side effects of const_missing
Fix secure_password password_confirmation validations
Merge pull request #11107 from nettsundere/password-confirmation-fix

Fix secure_password password_confirmation validations
acually get the actual source reflection :cry::gun:
eliminate conditional in JoinHelper
oops!
Refactor to use flat_map
Add `#any_of` query method to active_record

This method is inspired by [any_of from
mongoid](http://two.mongoid.org/docs/querying/criteria.html#any_of).

It allows to compute an `OR` like query that leverages AR's `#where` syntax:

    manual_removal = User.where(id: params[:users][:destroy_ids])
    users = User.any_of(manual_removal, "email like '%@example.com'", {banned: true}).destroy_all

It can be used directly on model class, or through an association, or
behind an other relation.

    manual_removal = User.where(id: params[:users][:destroy_ids])
    User.any_of(manual_removal, "email like '%@example.com'", {banned: true})
    @company.users.any_of(manual_removal, "email like '%@example.com'", {banned: true})
    User.where(offline: false).any_of( manual_removal, "email like '%@example.com'", {banned: true})

Its main purpose is to both :

* remove the need to write a sql string when we want an `OR`
* allow to write dynamic `OR` queries, which would be a pain with a string

There's also a negative version, `#none_of`. This will return all active
users :

    banned_users = User.where(banned: true)
    unconfirmed_users = User.where("confirmed_at IS NULL")
    active_users = User.none_of(banned_users, unconfirmed_users)