aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #24958 from maclover7/fix-24955Rafael França2016-05-202-1/+11
|\ | | | | Fix ActiveRecord::LogSubscriber edge case
| * Fix ActiveRecord::LogSubscriber edge caseJon Moss2016-05-102-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 ```
* | Revert "Make sure the cache is always populated"Rafael Mendonça França2016-05-202-6/+2
| | | | | | | | | | | | This reverts commit 0ce7eae7418f1b9bb06b351c1f26d50c3674c0d0. Tests were broken https://travis-ci.org/rails/rails/jobs/131850726#L520
* | Merge pull request #24984 from kamipo/remove_magic_comment_in_schema.rbRafael França2016-05-202-8/+0
|\ \ | | | | | | Remove magic comment in generated `schema.rb`
| * | Remove magic comment in generated `schema.rb`Ryuta Kamizono2016-05-122-8/+0
| | | | | | | | | | | | | | | Rails 5.0 has been dropped Ruby 1.9 support. I think no need magic comment anymore.
* | | Add more test coverage to layoutsRafael Mendonça França2016-05-201-4/+152
| | | | | | | | | | | | [Rafael Mendonça França + Nick Sutterer + thedarkone]
* | | Make sure the cache is always populatedAaron Patterson2016-05-202-2/+6
| | | | | | | | | | | | This way we don't have to make multiple calls on anonymous controllers
* | | Merge pull request #25041 from maclover7/jm-actionviewAaron Patterson2016-05-201-9/+3
|\ \ \ | | | | | | | | [Action View] Don't create middleman `DetailsKey` instance
| * | | [Action View] Don't create middleman `DetailsKey` instanceJon Moss2016-05-161-9/+3
| | | | | | | | | | | | | | | | | | | | All of this is `nodoc`'ed, so we shouldn't have to worry about breaking changes, if there are any -- all internal API :).
* | | | Merge pull request #25085 from ↵Arthur Nogueira Neves2016-05-201-7/+1
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | bquorning/update-comment-for-retrieve_connection_pool Update comment for #retrieve_connection_pool
| * | | | [ci skip] Update retrieve_connection_pool commentBenjamin Quorning2016-05-201-7/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | | Merge pull request #25084 from y-yagi/fix_module_nameVipul A M2016-05-201-1/+1
|\ \ \ \ \ | |/ / / / |/| | | | fix module name [ci skip]
| * | | | fix module name [ci skip]yuuji.yaginuma2016-05-201-1/+1
|/ / / /
* | | | Merge pull request #25080 from maclover7/jm-add-oxfordRafael França2016-05-201-1/+1
|\ \ \ \ | | | | | | | | | | Add back in Oxford Comma
| * | | | Add back in Oxford CommaJon Moss2016-05-191-1/+1
|/ / / / | | | | | | | | | | | | | | | | | | | | per [API documentation guidelines](http://edgeguides.rubyonrails.org/api_documentation_guidelines.html#oxford-comma) [ci skip]
* | | | Merge pull request #25070 from josedonizetti/fix_example_routes_docArthur Nogueira Neves2016-05-191-3/+3
|\ \ \ \ | | | | | | | | | | fix named route example [ci skip]
| * | | | fix named route example [ci skip]Jose Donizetti2016-05-191-3/+3
| | | | |
* | | | | Support for unified Integer class in Ruby 2.4+Jeremy Daer2016-05-1843-119/+116
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | Merge pull request #19428 from bdmac/fix_safe_buffer_titleizeRafael Mendonça França2016-05-181-1/+2
|\ \ \ \ | | | | | | | | | | | | | | | Fixes Inflector#titleize to work with SafeBuffer
| * | | | Fixes Inflector#titleize to work with SafeBufferBrian McManus2015-03-203-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | | Merge pull request #25067 from ro31337/patch-2Rafael França2016-05-181-0/+1
|\ \ \ \ \ | | | | | | | | | | | | Improve method description
| * | | | | Improve method descriptionRoman Pushkin2016-05-181-0/+1
|/ / / / / | | | | | | | | | | Method description improved to reflect little bit more complicated scenario when names are camel-cased.
* | | | | Merge pull request #25066 from mohitnatoo/rails-validation-happensRafael França2016-05-181-4/+2
|\ \ \ \ \ | | | | | | | | | | | | Removing redundant 'happens' in callbacks documentation
| * | | | | - removing redundant 'happens' in documentation [ci skip]Mohit Natoo2016-05-191-4/+2
|/ / / / /
* | | | | Merge pull request #25059 from maclover7/jm-capitalize-md5Rafael França2016-05-172-4/+4
|\ \ \ \ \ | | | | | | | | | | | | `md5` --> `MD5`
| * | | | | `md5` --> `MD5`Jon Moss2016-05-172-4/+4
|/ / / / / | | | | | | | | | | | | | | | | | | | | Sorry, I missed a few places in my last PR. This should be the last of 'em :grimacing:
* | | | | Merge pull request #25052 from matkoniecz/2008_is_not_recentJon Moss2016-05-171-3/+1
|\ \ \ \ \ | | | | | | | | | | | | update to make it less obvious that this guide is from 2008/2009
| * | | | | update to make it less obvious that this guide is from 2008/2009Mateusz Konieczny2016-05-171-3/+1
| | |/ / / | |/| | | | | | | | | | | | | | | | | | malicious ads are neither new nor unusual live HTTP headers project is dead - see https://www.mozdev.org/bugs/show_bug.cgi?id=25944
* | | | | keep layouts + locals from bloating the cacheAaron Patterson2016-05-173-3/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | | Safari 4 supports http only cookie (#25053)Mateusz Konieczny2016-05-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | * 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
* | | | | locals can be accessed from templates rendered in the controllerAaron Patterson2016-05-171-0/+16
| | | | |
* | | | | Merge pull request #25039 from maclover7/jm-capitalization-2Jon Moss2016-05-171-15/+15
|\ \ \ \ \ | |/ / / / |/| | | | Fix security guide capitalization errors
| * | | | Fix security guide capitalization errorsJon Moss2016-05-161-15/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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]Vipul A M2016-05-171-1/+68
|\ \ \ \ \ | | | | | | | | | | | | Add Attributes API to release notes [ci skip]
| * | | | | Add Attributes API to release notesVipul A M2016-04-141-1/+68
| | | | | | | | | | | | | | | | | | | | | | | | [ci skip]
* | | | | | Merge pull request #25036 from maclover7/jm-capitalizationJon Moss2016-05-161-3/+3
|\ \ \ \ \ \ | |_|/ / / / |/| | | | | `md5` --> `MD5`
| * | | | | `md5` --> `MD5`Jon Moss2016-05-161-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | [ci skip]
* | | | | | Update the Rails security guide [ci skip]Vipul A M2016-05-171-2/+2
|\ \ \ \ \ \ | |/ / / / / |/| | | | | Update the Rails security guide [ci skip]
| * | | | | Update the Rails security guideRalin Chimev2016-05-161-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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]
* | | | | | Remove extranous spaces from assignment.Kasper Timm Hansen2016-05-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Leftover from an earlier commit, chose to fix because I was just down in this file.
* | | | | | Replace middleware with executor callback.Kasper Timm Hansen2016-05-162-8/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | | | Merge pull request #24203 from sferik/count_with_blockKasper Timm Hansen2016-05-165-6/+28
|\ \ \ \ \ \ | | | | | | | | | | | | | | Forward ActiveRecord::Relation#count to Enumerable#count if block given
| * | | | | | Forward ActiveRecord::Relation#count to Enumerable#count if block givenErik Michaels-Ober2016-03-195-6/+28
| | | | | | |
* | | | | | | Merge pull request #24930 from henrik/date-all-daySean Griffin2016-05-163-5/+22
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Introduce Date#all_day
| * | | | | | | Introduce Date#all_dayHenrik Nyh2016-05-113-5/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | | | | | Merge pull request #25009 from jahfer/suppressor-keep-stateSean Griffin2016-05-162-1/+14
|\ \ \ \ \ \ \ \ | |_|_|/ / / / / |/| | | | | | | Keep previous state around for nested calls to #suppress
| * | | | | | | Keep state around for nested calls to #suppressJahfer Husain2016-05-162-1/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | | | | | Merge pull request #23810 from xijo/fix_json_coder_when_mysql_strict_is_disabledSean Griffin2016-05-163-1/+20
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix bug in JSON deserialization when column default is an empty string
| * | | | | | | | Fix bug in JSON deserialization when column default is an empty stringJohannes Opper2016-02-223-1/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | | | | | | Merge pull request #25023 from slbug/patch-1Sean Griffin2016-05-162-0/+9
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | Rails 5.1 point type should not raise exception if empty string is provided as input