| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
* #uniq is an alias of #distinct
* #uniq will be deprecated, see: rails/rails@adfab2dcf4003ca564d78d4425566dd2d9cd8b4f
|
| |
|
|\
| |
| |
| |
| |
| | |
Errors can be indexed with nested attributes
Close #8638
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
`has_many` can now take `index_errors: true` as an
option. When this is enabled, errors for nested models will be
returned alongside an index, as opposed to just the nested model name.
This option can also be enabled (or disabled) globally through
`ActiveRecord::Base.index_nested_attribute_errors`
E.X.
```ruby
class Guitar < ActiveRecord::Base
has_many :tuning_pegs
accepts_nested_attributes_for :tuning_pegs
end
class TuningPeg < ActiveRecord::Base
belongs_to :guitar
validates_numericality_of :pitch
end
```
- Old style
- `guitar.errors["tuning_pegs.pitch"] = ["is not a number"]`
- New style (if defined globally, or set in has_many_relationship)
- `guitar.errors["tuning_pegs[1].pitch"] = ["is not a number"]`
[Michael Probber, Terence Sun]
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| | |
Reason: That one is an Oxford comma, as per our guidelines. See:
http://edgeguides.rubyonrails.org/api_documentation_guidelines.html#comma
This reverts commit f184cd34f9ef35ddf85a23c2fb02cc05d3fb26b3.
|
| | |
|
| |
| |
| |
| | |
We use one period after spaces, not two.
|
|\ \
| | |
| | | |
Use Module.prepend instead of alias_method and unify behavior of all Numeric extensions
|
| | |
| | |
| | |
| | | |
alias_method
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Original:
* `config.active_record.belongs_to_required_by_default` is a boolean
value and controls whether `belongs_to` association is required by
default.
Modified version:
* `config.active_record.belongs_to_required_by_default` is a boolean
value and controls whether validation error is triggered by
default if `belongs_to` association is not present or not valid.
|
|\ \ \
| | | |
| | | | |
activerecord guide: clarified roles of valid method and errors object [ci skip]
|
| | | | |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Sure this is `destroy` method of PhotosController, but in this chapter
these methods which mapped by the router are called "action".
For example:
```ruby
get '/patients/:id', to: 'patients#show'
```
is described to dispatch "controller's `show` action".
|
| | | | |
|
| | | |
| | | |
| | | |
| | | |
| | | | |
* adds/removes a few words
* removes an unnecessary comma
|
| | | |
| | | |
| | | |
| | | | |
If you can't start your queue, you won't process much. This change adds external links to the Queue backends that have Active Job specific docs.
|
| | | |
| | | |
| | | | |
Add 'db/'; corrects structure.rb to structure.sql
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
I added that *structure.sql* file can be used when *db:reset* is run.
*db:reset* tasks states *db:reset* loads database from *db/schema.rb*
or *db/structure.sql* depending on the configuration (although
*db/schema.rb* is the default), hence the change.
|
| | | | |
|
| | | | |
|
|\ \ \ \
| | | | |
| | | | | |
Minor cleanup for form helpers guide
|
| | | | | |
|
| | | | | |
|
|/ / / /
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
This reverts commit afe672185d5eba95f387c46f855ae7a21ea69fa5.
Reason: This change was done by mistake. This option is at the `config`
object not in the `config.assets`.
See
https://github.com/rails/rails/blob/cfb371e96a2789790359ec1db779df490fd253d6/railties/lib/rails/application/configuration.rb#L16
|
| | | |
| | | |
| | | |
| | | |
| | | | |
Correct spelling is "Esperanto":
https://en.wikipedia.org/wiki/Esperanto
|
|\ \ \ \
| | | | |
| | | | | |
Fix typo in docs
|
| | | | | |
|
|/ / / / |
|
| | | | |
|
| | | | |
|
|\ \ \ \
| | | | |
| | | | | |
Change "parse_query" to "parse_nested_query"
|
| | | | |
| | | | |
| | | | |
| | | | | |
[ci skip]
|
| | | | | |
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Some translations of rails guides has their own documents.yaml, for example
Japanese:
https://github.com/yasslab/railsguides.jp/blob/japanese/guides/source/documents.yaml
Traditional Chinese:
https://github.com/docrails-tw/guides/blob/master/rails_guides/helpers.rb#L21,L27
https://github.com/docrails-tw/guides/blob/master/source/documents_zh-TW.yaml
The [Translating Rails Guides](https://github.com/rails/docrails/wiki/translating-rails-guides) says
> Copy the contents of guides/source into your own language directory and translate them.
So that sounds ok to copy guides/source/documents.yaml into language
specific directly and translating them like other markdown files.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Add more info on working with postgres ENUM type
|
| | | | | | |
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
Update text on CSS Injection
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
[skip ci]
|
|\ \ \ \ \ \ \ |
|
| | | | | | | | |
|
| | | | | | | | |
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
This reverts commit 37423e4ff883ad5584bab983aceb4b2b759a1fd8.
Jeremy is right that we shouldn't remove this. The fact is that many
engines are depending on this middleware to be in the default stack.
This ties our hands and forces us to keep the middleware in the stack so
that engines will work. To be extremely clear, I think this is another
smell of "the rack stack" that we have in place. When manipulating
middleware, we should have meaningful names for places in the req / res
lifecycle **not** have engines depend on a particular constant be in a
particular place in the stack. This is a weakness of the API that we
have to figure out a way to address before removing the constant.
As far as timing attacks are concerned, we can reduce the granularity
such that it isn't useful information for hackers, but is still useful
for developers.
|
| |/ / / / / /
|/| | | | | | |
|
|\ \ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
use class to specify the middleware [ci skip]
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
using string for middleware class names is deprecated in 83b767cef90abfc4c2ee9f4b451b0215501fae9a
|
|/ / / / / / /
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
The runtime header is a potential target for timing attacks since it
returns the amount of time spent on the server (eliminating network
speed). Total time is also not accurate for streaming responses.
The middleware can be added back via:
```ruby
config.middleware.ues ::Rack::Runtime
```
|