| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| | |
Fix ActiveRecord::LogSubscriber edge case
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
If an attribute was of the binary type, and also was a Hash, it would
previously not be logged, and instead raise an error saying that
`bytesize` was not defined for the `attribute.value` (a `Hash`).
Now, as is done on 4-2-stable, the attribute's database value is
`bytesize`d, and then logged out to the terminal.
Reproduction script:
```ruby
require 'active_record'
require 'minitest/autorun'
require 'logger'
ActiveRecord::Base.establish_connection(adapter: 'sqlite3', database: ':memory:')
ActiveRecord::Base.logger = Logger.new(STDOUT)
ActiveRecord::Schema.define do
create_table :posts, force: true do |t|
t.binary :preferences
end
end
class Post < ActiveRecord::Base
serialize :preferences
end
class BugTest < Minitest::Test
def test_24955
Post.create!(preferences: {a: 1})
assert_equal 1, Post.count
end
end
```
|
| |
| |
| |
| |
| |
| | |
This reverts commit 0ce7eae7418f1b9bb06b351c1f26d50c3674c0d0.
Tests were broken https://travis-ci.org/rails/rails/jobs/131850726#L520
|
|\ \
| | |
| | | |
Remove magic comment in generated `schema.rb`
|
| | |
| | |
| | |
| | |
| | | |
Rails 5.0 has been dropped Ruby 1.9 support.
I think no need magic comment anymore.
|
| | |
| | |
| | |
| | | |
[Rafael Mendonça França + Nick Sutterer + thedarkone]
|
| | |
| | |
| | |
| | | |
This way we don't have to make multiple calls on anonymous controllers
|
|\ \ \
| | | |
| | | | |
[Action View] Don't create middleman `DetailsKey` instance
|
| | | |
| | | |
| | | |
| | | |
| | | | |
All of this is `nodoc`'ed, so we shouldn't have to worry about breaking
changes, if there are any -- all internal API :).
|
|\ \ \ \
| | | | |
| | | | |
| | | | |
| | | | | |
bquorning/update-comment-for-retrieve_connection_pool
Update comment for #retrieve_connection_pool
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
After PR https://github.com/rails/rails/pull/24844 the documentation for
`#retrieve_connection_pool` was out of date. This commit changes:
- the reference from `@class_to_pool` to `@owner_to_pool`.
- with newer Rubies, `#fetch` isn't significantly slower than `#[]`. Since Rails 5
requires Ruby >= 2.2.2, we can just use `#fetch` here.
|
|\ \ \ \ \
| |/ / / /
|/| | | | |
fix module name [ci skip]
|
|/ / / / |
|
|\ \ \ \
| | | | |
| | | | | |
Add back in Oxford Comma
|
|/ / / /
| | | |
| | | |
| | | |
| | | |
| | | | |
per [API documentation guidelines](http://edgeguides.rubyonrails.org/api_documentation_guidelines.html#oxford-comma)
[ci skip]
|
|\ \ \ \
| | | | |
| | | | | |
fix named route example [ci skip]
|
| | | | | |
|
|/ / / /
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Ruby 2.4 unifies Fixnum and Bignum into Integer: https://bugs.ruby-lang.org/issues/12005
* Forward compat with new unified Integer class in Ruby 2.4+.
* Backward compat with separate Fixnum/Bignum in Ruby 2.2 & 2.3.
* Drops needless Fixnum distinction in docs, preferring Integer.
|
|\ \ \ \
| | | | |
| | | | |
| | | | | |
Fixes Inflector#titleize to work with SafeBuffer
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
The way Inflector#titleize was implemented did not work properly when
called on a SafeBuffer object. Using the global `$&` variable in the
gsub resulted in calling capitalize on a nil object for reasons I still
do not fully understand. Removing the UNSAFE_STRING_METHODS override for
the gsub method in SafeBuffer "fixed" the bug but is obviously
unacceptable.
An example of this is very easy to see in rails console:
ActiveSupport::SafeBuffer.new("my test").titleize
> NoMethodError: undefined method `capitalize' for nil:NilClass
Using the non global version of gsub with a |match| arg passed to the
block fixes the problem. Again I do not quite understand why. I noticed
that other parts of Inflector were already using the standard block arg
version of gsub so I don't think it should be a problem to convert this
method to using it as well.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Improve method description
|
|/ / / / /
| | | | |
| | | | | |
Method description improved to reflect little bit more complicated scenario when names are camel-cased.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Removing redundant 'happens' in callbacks documentation
|
|/ / / / / |
|
|\ \ \ \ \
| | | | | |
| | | | | | |
`md5` --> `MD5`
|
|/ / / / /
| | | | |
| | | | |
| | | | |
| | | | | |
Sorry, I missed a few places in my last PR. This should be the last of
'em :grimacing:
|
|\ \ \ \ \
| | | | | |
| | | | | | |
update to make it less obvious that this guide is from 2008/2009
|
| | |/ / /
| |/| | |
| | | | |
| | | | |
| | | | | |
malicious ads are neither new nor unusual
live HTTP headers project is dead - see https://www.mozdev.org/bugs/show_bug.cgi?id=25944
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Using locals will cause layouts to be cached multiple times in the
template cache. This commit removes locals from consideration when
looking up the layout.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
* Update documentation about Safari 4 supporting http only cookie
- Source: www.greebo.net/2009/06/09/httponly-in-safari-40-release/ via http://stackoverflow.com/questions/528405/which-browsers-do-support-httponly-cookies
|
| | | | | |
|
|\ \ \ \ \
| |/ / / /
|/| | | | |
Fix security guide capitalization errors
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Would have submitted to docrails, but this guide was just changed today,
and docrails doesn't have the most updated version :grimacing:
cc @vipulnsward
[ci skip]
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Add Attributes API to release notes [ci skip]
|
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
[ci skip]
|
|\ \ \ \ \ \
| |_|/ / / /
|/| | | | | |
`md5` --> `MD5`
|
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
[ci skip]
|
|\ \ \ \ \ \
| |/ / / / /
|/| | | | | |
Update the Rails security guide [ci skip]
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Bring up-to-date the information about the session id in the
Sessions section. The guide currently says that the session
id is a md5 hash while the implementation uses a random hex
string.
Fixes #25032.
[ci skip]
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Leftover from an earlier commit, chose to fix because I was
just down in this file.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Per request digest caches were added before we had hooks into
different units of work that Rails performs.
As such the most reliable way to prevent stale cache digests
was with a middleware. The middleware prevented staleness in
Action Controller requests.
However, the executor is superior because it should also prevent
staleness when running just Active Job jobs or broadcasting
through Action Cable's server.
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
Forward ActiveRecord::Relation#count to Enumerable#count if block given
|
| | | | | | | |
|
|\ \ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
Introduce Date#all_day
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
Useful for queries like:
Item.where(created_at: Date.current.all_day)
There was already a Time#all_day with the same behaviour, but for
queries like the above, Date is more convenient.
|
|\ \ \ \ \ \ \ \
| |_|_|/ / / / /
|/| | | | | | | |
Keep previous state around for nested calls to #suppress
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
If a call to #suppress from the same class occurred inside another #suppress
block, the suppression state would be set to false before the outer block
completes.
This change keeps the previous state around in memory and unwinds it
as the blocks exit.
|
|\ \ \ \ \ \ \ \
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
Fix bug in JSON deserialization when column default is an empty string
|
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
When `ActiveRecord::Coders::JSON` serialization is used and the default of the column returns `''` it raises the following error:
```
JSON::ParserError: A JSON text must at least contain two octets!
```
If MySQL is running in non-strict mode, it returns an empty string as column default for a text column:
```ruby
def extract_default
if blob_or_text_column?
@default = null || strict ? nil : ''
end
end
```
Since `''` is invalid JSON, there shouldn't be an attempt to parse it, it should be treated like nil.
ActiveRecord::Coders::JSON should behave consistently for all possible non-user-set column default values.
|
|\ \ \ \ \ \ \ \ \
| | | | | | | | | |
| | | | | | | | | | |
Rails 5.1 point type should not raise exception if empty string is provided as input
|