| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| | | | | | | |
|
| | | | | | | |
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
If the options :shallow_prefix and :shallow_path are not set in the
scope options then copy them from the normal :as and :path options
if they are set.
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
If a developer has specified either :path or :as in the options hash then
these should be used as the defaults for :shallow_path and :shallow_prefix.
Fixes #14241.
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
By tracking the depth of resource nesting we can push the need for nested
shallow scoping to only those routes that are nested more than one deep.
This allows us to keep the fix for #12498 and fix the regression in #14224.
Fixes #14224.
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Originally with_scope_level was exclusively for managing scope levels with
resources, however it is now used for other things so it makes more sense
to move the responsibility for setting the :scope_level_resource to the
resource_scope method. This eliminates repeatedly setting it to the same
resource as each resource method scope is evaluated.
|
|\ \ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
Fix errors for four of the code samples [ci skip]
|
|/ / / / / / /
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
The four code samples that fail to run are:
- Add attribute magic to objects. Fixed by introducing a Person
instance variable.
- Tracking value changes. Fixed by replacing `attr_accessor` with
`define_attribute_methods`, providing getter and setter methods
for `name` and providing the missing `Person#save` method. A
call to `Person#save` has to precede the `person.name = 'robert'`
assignment, if we want `previous_changes` to include 'bob'.
- Adding `errors` interface to objects. Fixed by introducing a
Person instance variable, assigning `nil` to its name and calling
`Person#validate!`.
- Custom validators. Fixed by defining `HasNameValidator` before
it is used by `ValidatorPerson`.
All the code samples can now be run smoothly.
Call Dirty#changes_applied in Person#save, instead of modifying instance vars.
|
|\ \ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
Make the rails:template rake task load initializers
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
Templates could rely on irregular inflections or external libraries for
instance so we should load the application's initializers when running
the rails:template task.
The introducing commit of this feature is f7f11361 ; the initializers
have never been loaded invoking this task.
Fixes #12133.
|
|\ \ \ \ \ \ \ \
| | | | | | | | |
| | | | | | | | | |
Fix OrderedHash.select to return self instance.
|
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
On ruby 2.1.1 the behavior of .select and .reject has changed.
They will return a Hash new instance, so we need to override them to
keep the instance object class.
|
|\ \ \ \ \ \ \ \ \
| |_|/ / / / / / /
|/| | | | | | | | |
Make CSRF failure logging optional/configurable.
|
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
Added the log_warning_on_csrf_failure option to ActionController::RequestForgeryProtection
which is on by default.
|
| | | | | | | | | |
|
| | | | | | | | | |
|
| | | | | | | | | |
|
|\ \ \ \ \ \ \ \ \
| | | | | | | | | |
| | | | | | | | | | |
Make sure we clean preview_interceptors
|
| | |_|_|/ / / / /
| |/| | | | | | |
| | | | | | | | |
| | | | | | | | | |
We should make sure we clean preview_interceptors after each test so they dont leaky to the next test
|
|\ \ \ \ \ \ \ \ \
| |/ / / / / / / /
|/| | | | | | | | |
Add preventDefault() on click event
|
|/ / / / / / / / |
|
|\ \ \ \ \ \ \ \
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
Conflicts:
guides/source/4_1_release_notes.md
|
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
Thank you @bquorning
|
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
[ci-skip]
Closes rails/rails#14294
|
| | | | | | | | | |
|
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
Based on comments at
https://github.com/rails/docrails/commit/42417b0013819e573be9ffc5402e179003156e8e#commitcomment-5527251
[skip ci]
|
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
[skip ci]
|
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
[skip ci]
|
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
This commit also addresses rails/docrails#169 and rails/rails#14159
|
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
the fact that Rails is multi-thread by default is not very relevant. see https://github.com/rails/rails/pull/13998 [ci skip]
|
| | | | | | | | | |
|
|\ \ \ \ \ \ \ \ \
| | | | | | | | | |
| | | | | | | | | | |
Add "Low-Level Caching" part to "Caching With Rails" guide
|
| | | | | | | | | | |
|
|\ \ \ \ \ \ \ \ \ \
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | | |
sikachu/master-revert-render-body-remove-content-type
Do note remove `Content-Type` when `render :body`
|
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | | |
`render :body` should just not set the `Content-Type` header. By
removing the header, it breaks the compatibility with other parts.
After this commit, `render :body` will returns `text/html` content type,
sets by default from `ActionDispatch::Response`, and it will preserve
the overridden content type if you override it.
Fixes #14197, #14238
This partially reverts commit 3047376870d4a7adc7ff15c3cb4852e073c8f1da.
|
|\ \ \ \ \ \ \ \ \ \ \
| |_|_|_|_|_|_|_|/ / /
|/| | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | | |
joker1007/fix_rails_guides_about_active_record_default_timezone
Fix guide about `config.active_record.default_timezone` [ci skip]
|
|/ / / / / / / / / /
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
Now the initial value of ActiveRecord.default_timezone is always :utc
|
|\ \ \ \ \ \ \ \ \ \
| |/ / / / / / / / /
|/| | | | | | | | | |
Introduce `Rails.gem_version`
|
|/ / / / / / / / /
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
This method return `Gem::Version.new(Rails.version)`, suggesting a more
reliable way to perform version comparison.
Example:
Rails.version #=> "4.1.2"
Rails.gem_version #=> #<Gem::Version "4.1.2">
Rails.version > "4.1.10" #=> false
Rails.gem_version > Gem::Version.new("4.1.10") #=> true
Gem::Requirement.new("~> 4.1.2") =~ Rails.gem_version #=> true
This was originally introduced as `.version` by @charliesome in #8501
but got reverted in #10002 since it was not backward compatible.
Also, updating template for `rake update_versions`.
|
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
This actually not an issue fixing ; the changelog is referring to the
introducing pull request itself.
|
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
origin: https://github.com/rails/rails/commit/f6aeb8b1a3687c8523e4a56309fe3736011b2935#commitcomment-5569649
|
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
This is a result of the discussion at https://github.com/rails/rails/pull/14263/files#r10291489
|
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
This is a follow up to a668beffd64106a1e1fedb71cc25eaaa11baf0c1
|
| | | | | | | | | |
|
|\ \ \ \ \ \ \ \ \
| | | | | | | | | |
| | | | | | | | | | |
Follow up of #10732 - Allow string hash values on AR order method
|
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
This behavior has almost no performance impact:
String not allowed 66.910000 0.030000 66.940000 ( 67.024976)
String allowed 69.360000 0.030000 69.390000 ( 69.503096)
Benchmarked with http://git.io/Y0YuRw.
|
|\ \ \ \ \ \ \ \ \ \
| | | | | | | | | | |
| | | | | | | | | | | |
Make exists? use bound values.
|
| | |_|_|_|_|/ / / /
| |/| | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
When we build a query with an inline value that is a numeric (e.g.
because it's out of range for an int4) PostgreSQL doesn't use an index
on the column, since it's now comparing numerics and not int4s.
This leads to a _very_ slow query.
When we use bound parameters instead of inline values PostgreSQL
raises numeric_value_out_of_range since no automatic coercion happens.
|
| |_|_|_|/ / / / /
|/| | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
This reverts commit 475c96589ca65282e1a61350271c2f83f0d4044f, reversing
changes made to 705915ab5cf24430892107764b0050c07e1df583.
We decided that this is not worth busting everyone's cache as this
seems like a very unlikely problem. The problem only occurs when the
user is 1) not using a namespace, or 2) using the same namesapce for
different *kinds* of cache items. The recommended "fix" is to put
those cache items into their own namspace:
id = 1
Rails.cache.fetch(id, namespace: "user"){ User.find(id) }
ids = [1]
Rails.cache.fetch(ids, namespace: "users"){ User.find(ids) }
See the discussion on #14269 for details.
|
|\ \ \ \ \ \ \ \ \
| |_|/ / / / / / /
|/| | | | | | | | |
Cache key should be different when is Array.
|