Skip to content

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also .

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also .
...
This comparison is big! We’re only showing the most recent 250 commits
Commits on Feb 05, 2014
@marcandre marcandre Return sized enumerator from Enumerable#index_by a476020
@rafaelfranca rafaelfranca Merge pull request #13938 from marcandre/sized_enumerator
Sized enumerator
84fe7b7
@seanwalbran seanwalbran fix interplay of humanize and html_escape 26698fb
Commits on Feb 06, 2014
@rafaelfranca rafaelfranca Merge pull request #13953 from seanwalbran/fix-humanize-match-reference
fix interplay of humanize and html_escape
6cc3afb
@hpetru hpetru Fixed "Hash#to_param confused by empty hash values #13892" 326e652
@rafaelfranca rafaelfranca Move test to the right file 88b064d
@rafaelfranca rafaelfranca Test with a blank value d6e3fd7
@rafaelfranca rafaelfranca Refatoring the method to avoid shot-circuit return ab51b28
@rafaelfranca rafaelfranca Add CHANGELOG entry
Closes #13909
7aa4b7d
@rafaelfranca rafaelfranca Fix to_query with empty arrays too c82dbc6
@dpmehta02 dpmehta02 update contribution doc grammar. [ci skip]
- Manually applied from #13951.
- Discussion at #13947.
- Removed trailing whitespace from dpmehta02@18044e8

/cc @dpmehta02
b9ead0f
@senny senny synchronize 4.1 release notes with CHANGELOGS. [ci skip] 580f0b6
@senny senny docs, Associations also raise on name conflicts. [ci skip] 7f648bc
@emilsoman emilsoman Add config to disable schema dump after migration
* Add a config on Active Record named `dump_schema_after_migration`
* Schema dump doesn't happen if the config is set to false
* Set default value of the config to true
* Set config in generated production environment file to false
* Update configuration guide
* Update CHANGELOG
8806768
@fxn fxn Merge branch 'dump-schema-after-migration-flag' of git://github.com/e…
…milsoman/rails into emilsoman-dump-schema-after-migration-flag

Conflicts:
	activerecord/CHANGELOG.md
c0fb8d0
Ionatan Wiznia Tests that skips a controller filters that was set up using a class f8d740a
Commits on Feb 07, 2014
@senny senny Merge pull request #13962 from iwiznia/test_controller_skip_action_class
Test for skipping a controller filter set up with a class Part 3
e3d8194
@calvintam calvintam Fixed spelling error: `extracetd` => `extracted` 2fdbd59
@kintamanimatt kintamanimatt Fix wordy sentence bb87c16
@senny senny Merge pull request #13968 from kintamanimatt/fix-wordy-sentence
Fix wordy sentence [ci-skip]
2248684
@fphilipe fphilipe Require action_view to fix missing constant
Previously, requiring action_view/view_paths did cause an uninitialized
constant error for ENCODING_FLAG, which is defined in action_view.
47860b6
@prathamesh-sonpatki prathamesh-sonpatki [Testing Guide] Mention :unauthorized in assert_response explanation …
…[ci skip]
8fffcfc
@senny senny Merge pull request #13967 from fphilipe/fix-missing-action-view-const
Require action_view to fix missing constant ENCODING_FLAG
9da2ae1
@senny senny Merge pull request #13952 from prathamesh-sonpatki/testing
[Testing Guide] Mention :unauthorized in assert_response explanation [ci skip]
ed66361
Commits on Feb 08, 2014
@pixeltrix pixeltrix Adjust test value so that timezone has no effect
If the test is run in a timezone that is behind UTC it fails because
the time generated is ahead of 0000-01-01 00:00:00. Just increase the
time subtracted so that timezone has no effect.
3f90787
@senny senny docs, Cookie values are String based. Closes #12860. [ci skip] 519deb6
@robin850 robin850 Rely on backticks instead of tt tags [ci skip]
Since the language in code blocks is inferred, if the code contains tt
tags, the block will be parsed as XML for instance while it is Ruby.
50d828c
@Fortisque Fortisque context in validation goes through has many relationship 5e3d466
@chancancode chancancode Updated the cookie docs to use the safer JSON.{generate,parse} 7757714
@laurocaetano laurocaetano Add test case for autosave HasMany with accepts_nested_attributes.
It should not save the parent record when the nested attributes are
invalid.

Test case to cover #8194.
1ea61cb
@rafaelfranca rafaelfranca Merge pull request #13974 from laurocaetano/test_case_for_autosave_wi…
…th_accepts_nested_attributes

Add test case for autosave association with nested attributes.
3c2fe5c
@Octember Octember Fixed an issue where reloading of removed dependencies would cause an…
… unexpected circular dependency error
4fa8c8b
Commits on Feb 09, 2014
@mellowi mellowi Skips tests on Windows that create files with illegal characters ccd1c43
@tenderlove tenderlove Merge pull request #13977 from Octember/master
Fixed an issue where reloading of removed dependencies would cause an un...
3c8e0a4
@tenderlove tenderlove Merge pull request #13979 from mellowi/windows_disallowed_static_file…
…s_skipped

Skips tests on Windows that create files with illegal characters
1ec25d1
@mellowi mellowi Skips linked folder tests if symlink is invalid 28a450d
@tenderlove tenderlove Merge pull request #13980 from mellowi/skipping_linked_folder_tests_i…
…f_symlink_is_invalid

Skips linked folder tests if symlink is invalid
3b684dd
@tenderlove tenderlove Merge pull request #13978 from Fortisque/kevin/validation_context_for…
…_children

context in validation goes through has many relationship
f99b254
@Fortisque Fortisque Reaper has access to threadsafe active? call 02a3c0e
@myronmarston myronmarston Add missing test for response destructuring. cbd10e2
@zzak zzak Remove outdated TODO from url_for test, this test was fixed in 900a2d3 dfe9cf1
@tenderlove tenderlove Merge pull request #13981 from Fortisque/kevin/postgresql_reaper_thre…
…adsafe

Reaper has access to threadsafe active? call
e4dc303
@tenderlove tenderlove use feature detection to decide which implementation to use
Decouple the code from the particular Ruby version.
76af5c1
@dskang dskang Prevent [response].flatten from recursing infinitely.
Returning `self` from within the array returned by `to_ary`
caused this. Instead, we can just substitute another object.
It provides the `each` behavior required by the rack spec.
069bc27
@hsbt hsbt use File.exist? instead of File.exists? a09c078
@chancancode chancancode Merge pull request #13983 from hsbt/remove-warning
use File.exist? instead of File.exists?
6ac2655
@zzak zzak FilterParameters is referenced at the class level from the Request
Since it's already required in the file, we don't need to use autoload
too. This commit is symmetrical change to 0b10180 for Response.
8d7923b
@zzak zzak Fix grammar of internal comment and modify it's location dbe3345
@zzak zzak Specify what #starts_with? we're talking about. Also added a note what
kind of exception we should expect for this internal comment.
17b0edd
@senny senny docs, link MySQL manual for multi column indexes. [ci ckip].
Closes #9131.
4e4a92e
@zzak zzak Use full-length version of multiple from c7abc51 605c81b
@fxn fxn adds a section about booleans in the API guidelines [ci skip] 7afd92e
@zzak zzak Fixed a grammatical error in Booleans section of API documentation guide
from e1e17a5
ae7580a
@dmitry dmitry move alias method `sanitize_conditions` to a correct place 424b2d8
@dmitry dmitry add activerecord test coverage for `sanitize_sql_array`
check it is handles empty statement
ec43584
@zzak zzak Remove end of line whitespace from bb87c16 a503444
@carlosantoniodasilva carlosantoniodasilva Merge pull request #13985 from zzak/remove_old_todo_in_url_for_test
Remove outdated TODO from url_for test, this test was fixed in 900a2d3
e08514e
@rafaelfranca rafaelfranca Merge pull request #13990 from zzak/ap_dont_autoload_filter_parameters
FilterParameters is referenced at the class level from the Request
a5ee843
@tenderlove tenderlove Merge pull request #13982 from dskang/fix-response-flatten-infinite-r…
…ecursion

Fix response flatten infinite recursion
33be58b
@elysdir elysdir Clarifying confusing phrasing f25e411
@vijaydev vijaydev Merge branch 'master' of github.com:rails/docrails
Conflicts:
	guides/source/active_record_validations.md
	guides/source/api_documentation_guidelines.md
	guides/source/configuring.md
92fdd65
@vijaydev vijaydev Merge pull request #13994 from elysdir/master
Clarifying confusing phrasing
8b5d08a
@vijaydev vijaydev Merge pull request #13630 from seapy/master
Fixed typo [ci skip]
ccd908f
@vijaydev vijaydev Simplify doc [ci skip]
The `as` option was already explained in a previous example
and doesn't need to be repeated. Explain only the `locals` option
which the example is meant for.
72e11ab
@dmitry dmitry add actionmailer test coverage for undefined delivery method 5af7cab
@dmitry dmitry add test coverage for activemodel Dirty#reset_changes 8acd58f
@pixeltrix pixeltrix Set the :shallow_path as each scope is generated
If we set :shallow_path when shallow is called it can result in incorrect
paths if the resource is inside a namespace because namespace itself sets
the :shallow_path option to the namespace path.

We fix this by removing the :shallow_path option from shallow as that should
only be turning shallow routes on and not otherwise affecting the scope.
To do this we need to treat the :shallow option to resources differently to
other scope options and move it to before the nested block is called.

This change also has the positive side effect of making the behavior of the
:shallow option consistent with the shallow method.

Fixes #12498.
462d7cb
@rafaelfranca rafaelfranca Merge pull request #13997 from dmitry/test_coverage_improvement
Test coverage improvement
e4911e9
@gaurish gaurish `Rails.threadsafe!` mode is deprecated
[ci skip]
395bcb5
@bak bak A pass over the Getting Started guide sections 1, 2, and 3 [ci skip]
* Add note about managing Ruby environments
* Point to curated lists of Ruby learning resources
* Expound on DRY and Convention over Configuration
* Remove note on superuser--thankfuly coders new to Rails don't have to sudo anymore :)
* Installation/verification instructions for SQLite3, since it's a dependency
2868bab
@robin850 robin850 Merge pull request #13998 from gaurish/doc-rails-threadsafe
`Rails.threadsafe!` mode is deprecated, Update Docs [ci skip]
3a428f3
Commits on Feb 10, 2014
@senny senny docs, mention that the current inflection rules are frozen. [ci skip]
Closes #13993.
07c7024
@jcoyne jcoyne Fix tidy_bytes for JRuby
The previous implementation was broken because JRuby (1.7.10) doesn't
have a code converter for UTF-8 to UTF8-MAC.
ae28e4b
@senny senny docs, update broken link. [ci skip] 56fa194
@senny senny docs, link to HTTP and CGI header definitions. [ci skip]
This was a reaction to: rails#9700 (comment)
3b868cc
@rafaelfranca rafaelfranca Merge pull request #13919 from jcoyne/fix_jruby_encoding
Fix tidy_bytes for JRuby
e063dbc
@rafaelfranca rafaelfranca Avoid using deprecated arel constants 73a431a
@kintamanimatt kintamanimatt Add missing directory slashes [ci skip] 67e6dee
@rafaelfranca rafaelfranca Merge pull request #14007 from kintamanimatt/missing_directory_slashes
Add missing directory slashes [ci skip]
488885a
Commits on Feb 11, 2014
@zzak zzak Add tip about using RDoc's --pipe command to quickly test the output of
a piece of documentation.

This can be useful for trying out combinations of markup and code, as
discussed in rails/rails@225bcad
5c3eda8
@senny senny docs, hide inflector comment targeting only contributors. [ci skip]
This is a follow up to: rails@07c7024

As suggested by @fxn this comment should not be visible in the API:
rails@07c7024#commitcomment-5331658
92f567a
@carlosantoniodasilva carlosantoniodasilva Merge pull request #14008 from udaykadaboina/jqueryUpgrade
Upgraded jquery-rails gem version
f0d8996
@chancancode chancancode Renamed session_serializer option to cookies_serializer b927d67
@chancancode chancancode Just very so slightly better test coverage 54641fa
@chancancode chancancode Added HybridSerializer to upgrade existing marshal cookies (wip: need…
… tests)
fafe8ec
@chancancode chancancode Removed an old test 25f68ac
@rafaelfranca rafaelfranca Tests for the HybridSerializer d4b7aa7
@chancancode chancancode Fixed minor typo in test code 6de4888
@chancancode chancancode Changed the tests to ensure HybridSerializer actually migrates the co…
…okies (currently failing)
ba6861d
@guilleiguaran guilleiguaran Convert FlashHash in a Hash with indifferent access a6ce984
@guilleiguaran guilleiguaran Stringify the incoming hash in FlashHash
Stringify the incoming as well to handle incoming symbol keys from
marshalled sessions
a668bef
@chancancode chancancode Re-write legacy (marshal) cookies on read ead947a
@guilleiguaran guilleiguaran Remove serializer option from session_store.rb template 3a89386
@guilleiguaran guilleiguaran Fix AppGeneratorTest: serializer option was removed from session_store cd5960e
@chancancode chancancode Fixed broken flash tests b97e087
@chancancode chancancode Missed FlashHash#replace 9fc7a6f
@chancancode chancancode Added changelog entry for Flash changes [ci skip] ecf04f1
@chancancode chancancode Updated CHANGELOG, docs, guides and release notes.
Also added a `cookies_serializer.rb` initializer to the app template.
0b86a6e
@chancancode chancancode Migrate hash-based cookie values correctly 7a3ef98
@chancancode chancancode rm warning about variable shadowing dafc0ee
@vijaydev vijaydev Merge pull request #13571 from bak/getting_started_guide
A pass over the Getting Started guide sections 1, 2, and 3 [ci skip]
888386a
@senny senny test case to illustrate current PostgreSQL composite behavior. 4b11dcc
@acapilleri acapilleri add patch in HTTP Verb Constraints [ci skip] 3a0cc5c
@guilleiguaran guilleiguaran Merge pull request #14015 from acapilleri/add_patch
add patch in HTTP Verb Constraints [ci skip]
b12c1b8
@devlinzed devlinzed Don't symbolize tainted data.
`I18n.locale=` symbolizes its argument, so passing it `params[:locale]`
allows one to DOS your application by visiting `...?locale=` URLS
repeatedly, with unique values, until the never-GCed symbols monopolize
the available memory.
ec0664a
@fxn fxn Merge pull request #14016 from devlinzed/i18n_doc_fix
Documentation: Don't symbolize tainted data. [ci skip]
4359bc6
@fxn fxn Revert "Don't symbolize tainted data." [ci skip]
Reason: i18n whitelists now locales without passing through symbols,
see https://github.com/svenfuchs/i18n/blob/master/lib/i18n.rb#L278.
Therefore, this snippet is no longer a good practice.

This reverts commit ec0664a.
e00ab2d
@tenderlove tenderlove add a send so `apply` can be called. Fixes #13510
THIS IS A HUGE HACK.  Thor does not allow us to define public methods
without turning them in to "thor tasks".  That means we cannot subclass
the `apply` method and make it public, so we have to make the method
private and call `send` on it.
c5034d6
@kayvannj kayvannj adding connection parameter to check_pending for migrations 2862cd8
@kayvannj kayvannj adding missed change f34e0c4
Commits on Feb 12, 2014
@xtian xtian Hide bundler output for `rails new` if quiet option is specified. 2c7471a
@prathamesh-sonpatki prathamesh-sonpatki [Testing Guide] Explain usage of assert_redirected_to with named rout…
…es and Active Record objects [ci skip]
42b2e32
@carlosantoniodasilva carlosantoniodasilva Merge pull request #14023 from prathamesh-sonpatki/assert_redirected_to
[Testing Guide] Explain usage of assert_redirected_to with named routes and ActiveRecord objects [ci skip]
6d14c22
@sferik sferik Update Travis settings for Rubinius af66c46
@carlosantoniodasilva carlosantoniodasilva Merge pull request #14026 from sferik/rbx-2
Update Travis settings for Rubinius
7d5454d
@senny senny Merge pull request #14025 from xtian/rails-new-quiet
Hide bundler output for `rails new` if quiet option is specified.
8cdd93a
@senny senny do not crash when `config/secrets.yml` is blank. 37e30d2
@iainbeeston iainbeeston Added tests to render helper that expect `render partial: @foo` to
automatically call @foo.to_partial_path

Calling `render @foo` allows local variables but not options to be
passed to the partial renderer. The correct way to render an object AND
pass options to the partial renderer is to pass the object in the
`:partial` parameter. However, there were previously no tests for this
behaviour (in `render_helper_test.rb` at least).
5b793a8
@rafaelfranca rafaelfranca Merge pull request #13761 from iainbeeston/refactor_out_render_object
Refactored object rendering in RenderingHelper#render into it's own method
4dc4204
@tenderlove tenderlove `execute` is a hotspot, so let's reduce branches 4bf7071
@matthewd matthewd Terminate the backend ourselves on PG 9.2+
This should make it harder to accidentally break this test.
3b645fd
@tenderlove tenderlove Merge pull request #14035 from matthewd/pg_terminate_backend
Terminate the backend ourselves on PG 9.2+
6e61da2
Commits on Feb 13, 2014
@10io 10io Fix coffeescript sample [ci skip]
Replace bind() with on() as suggested by the JQuery bind() documentation: https://api.jquery.com/bind/
d0b251e
@guilleiguaran guilleiguaran Merge pull request #14029 from senny/dont_crash_on_empty_secrets_yml
do not crash when `config/secrets.yml` is blank.
6a1b459
@guilleiguaran guilleiguaran Merge pull request #13945 from rails/json_cookie_serializer_improvements
Cookies serializer improvements
de5ef15
@lukaszx0 lukaszx0 Variant negotiation
Allow setting `request.variant` as an array - an order in which they will be
rendered.

For example:

  request.variant = [:tablet, :phone]

  respond_to do |format|
    format.html.none
    format.html.phone # this gets rendered
  end
f9b6b86
@arthurnn arthurnn Dont use Enumarator on join_association c387252
@senny senny tests are responsible to clean up afterwards.
remove created state after test execution, not before the next test.
This prevents the leak of the `ex` table outside of a single test.
ea3af7e
@hdabrows hdabrows Drop the correct index after reverting a migration
Previously when reverting a migration which added a named index it
would instead drop a corresponding index with matching columns but
without a name.
e1d4673
@dhh dhh Merge pull request #14043 from strzalek/variants-negotiation
Variant negotiation
f2dfa83
@lukaszx0 lukaszx0 Check if variant array contains only symbols 00a4af9
@guilleiguaran guilleiguaran Merge pull request #14045 from arthurnn/kill_fibers
Dont use Enumarator on join_association
24fc74c
@senny senny Merge pull request #14034 from hdabrows/drop-correct-index-when-rever…
…ting-migration

Drop the correct index after reverting a migration
ad48267
@dhh dhh Merge pull request #14047 from strzalek/variants-array-check
Check if variant array contains only symbols
9ec42f9
@tenderlove tenderlove speed up the collection proxy reader method, but slow down the constr…
…uctor
f9e4c3c
@pcreux pcreux Add hint to error message of task db:migrate:down b283190
@dhh dhh No variant should also be picked up by variant.any if variant.none is…
… not defined (just like any other variant)
bfc34fc
@tenderlove tenderlove JoinHelper is never reused, so there is no need to separate 0fddc3c
@tenderlove tenderlove rm delegate methods that are not actually used 500b1df
@tenderlove tenderlove :scissors: whitespace e804d07
@tenderlove tenderlove remove more delegate methods 7d897ab
Commits on Feb 14, 2014
@ktaragorn ktaragorn Getting started guide fixes & Explain X-SendFile a little better, wit…
…h links

Explain how form_for :article is able to pull in the properties of @article
Make it clear that article_id is generated due to the association set up

Add link to the rails function that uses X-Sendfile.
Add links to apache and nginx docs for the header
8e6d0fd
Rajarshi Das remove unused fixtures from sqlite3 test cases 680f7d9
@tbpgr tbpgr fix guide active_support_core_extensions. add Note to String#indent […
…ci skip]
0e19e35
@lantoli lantoli updated Travis build status image url 4f5aff9
@rafaelfranca rafaelfranca Merge pull request #14058 from lantoli/master
updated Travis build status image url
bcaef36
@carlosantoniodasilva carlosantoniodasilva Merge pull request #14059 from tbpgr/guides_active_support_core_ext
[Guides] fix guide active_support_core_extensions. add Note to String#indent [ci skip]
926781b
@carlosantoniodasilva carlosantoniodasilva Merge pull request #14057 from rajcybage/Ar_remove_unnecessary_fixtures
Remove unused fixtures from sqlite3 test case
112b58f
@carlosantoniodasilva carlosantoniodasilva Merge pull request #14048 from pcreux/better-error-message-db-migrate…
…-down

Add hint to error message of task db:migrate:down
cdda290
@kassio kassio fix path shown in mailer's templates aae455f
@rafaelfranca rafaelfranca Merge pull request #14060 from kassio/master
Fix path shown in mailer's templates
820f635
@davejachimiak davejachimiak Add verb to sanitization note 848e377
@rafaelfranca rafaelfranca Merge pull request #14061 from davejachimiak/add_verb_in_guides
Add verb to sanitization note
8ce72d9
@tenderlove tenderlove remove scope_chain delegate 279212d
@tenderlove tenderlove remove chain delegate a8775bb
@tenderlove tenderlove remove railties changes. fixes #14054
Squashed commit of the following:

commit 96991e8e919edfb20cc4120bca4e36ed51175d57
Author: Aaron Patterson <aaron.patterson@gmail.com>
Date:   Fri Feb 14 11:29:24 2014 -0800

    Revert "gems can be added or skipped from the template"

    This reverts commit 8beb42c.

    Conflicts:
    	railties/lib/rails/generators/rails/app/app_generator.rb
    	railties/test/generators/app_generator_test.rb

commit 35599c0e657245ef14ac0f28c9189ad16acf40e6
Author: Aaron Patterson <aaron.patterson@gmail.com>
Date:   Fri Feb 14 11:26:53 2014 -0800

    Revert "oops, template replay needs to happen after bundle. :orz:"

    This reverts commit 9104702.

    Conflicts:
    	railties/lib/rails/generators/rails/app/app_generator.rb

commit f519c3902c313db8e906a49251c91643b8e6499e
Author: Aaron Patterson <aaron.patterson@gmail.com>
Date:   Fri Feb 14 11:25:51 2014 -0800

    Revert "only ask for these ivars if the target responds to them"

    This reverts commit 656d412.

commit aa524a9428e3e4c45fe221f10a66a08efb827ab5
Author: Aaron Patterson <aaron.patterson@gmail.com>
Date:   Fri Feb 14 11:25:39 2014 -0800

    Revert "refactor generator tests to use block form of Tempfile"

    This reverts commit 6525182.

commit 7d3740549fa4dfa62e3761f8d4bc6d6d441256e7
Author: Aaron Patterson <aaron.patterson@gmail.com>
Date:   Fri Feb 14 11:25:25 2014 -0800

    Revert "add a more restricted codepath for templates fixes #13390"

    This reverts commit 2875b4a.

commit 525df0af1001918986cdfce59539fd2d52c4f32c
Author: Aaron Patterson <aaron.patterson@gmail.com>
Date:   Fri Feb 14 11:25:11 2014 -0800

    Revert "add a send so `apply` can be called.  Fixes #13510"

    This reverts commit c5034d6.
22a1a5a
@tenderlove tenderlove remove klass delegator 40a015f
@tenderlove tenderlove remove the reflection delegate a35325e
@tenderlove tenderlove clean up add_constraints signature db3f50c
@tenderlove tenderlove pass the tracker down the stack and construct it in the scope method 3b675f0
@tenderlove tenderlove pass the association and connection to the scope method 8e6ef92
@tenderlove tenderlove make a singleton for AssociationScope
AssociationScope no longer maintains state, so we're safe to keep a
singleton and save on GC time
213b2fb
Commits on Feb 15, 2014
@tenderlove tenderlove make most parameters to the AliasTracker required
This helps with our sanity.  The class is internal, we can refactor to a
"nice" API later.
c24ea24
@tenderlove tenderlove stop exposing table_joins 494a26d
@tenderlove tenderlove guarantee a list in the alias tracker so we can remove a conditional 4e823b6
@tenderlove tenderlove add factory methods for empty alias trackers
If we know the alias tracker is empty, we can create one that doesn't
use a hash with default block for counting.

ActiveRecord::Base.establish_connection(adapter: 'sqlite3',
                                        database: ':memory:')

ActiveRecord::Schema.define do
  create_table :posts, force: true do |t|
    t.integer :comments_count
  end

  create_table :comments, force: true do |t|
    t.integer :post_id
  end
end

class Post < ActiveRecord::Base; has_many :comments; end
class Comment < ActiveRecord::Base; belongs_to :post, counter_cache: true; end
10.times { Comment.create!(post: Post.create!) }

record = Post.first
association_name = :comments

Benchmark.ips do |x|
  reflection = record.class.reflect_on_association(association_name)
  association = reflection.association_class.new(record, reflection)
  x.report('assoc') do
    reflection.association_class.new(record, reflection)
  end
  x.report('reader') do
    association.reader;nil
  end
  x.report('combined') do
    reflection.association_class.new(record, reflection).reader;nil
  end
end

[aaron@higgins rails (tracker)]$ TEST=ips bundle exec ruby ../1bb5456b5e035343df9d/gistfile1.rb
-- create_table(:posts, {:force=>true})
   -> 0.0062s
-- create_table(:comments, {:force=>true})
   -> 0.0003s
Calculating -------------------------------------
               assoc       833 i/100ms
              reader     28703 i/100ms
            combined       839 i/100ms
-------------------------------------------------
               assoc     9010.3 (±3.8%) i/s -      44982 in   5.000022s
              reader  3214523.4 (±5.5%) i/s -   16016274 in   5.001136s
            combined     8841.0 (±5.8%) i/s -      44467 in   5.049269s

[aaron@higgins rails (tracker)]$ TEST=ips bundle exec ruby ../1bb5456b5e035343df9d/gistfile1.rb
-- create_table(:posts, {:force=>true})
   -> 0.0060s
-- create_table(:comments, {:force=>true})
   -> 0.0003s
Calculating -------------------------------------
               assoc       888 i/100ms
              reader     29217 i/100ms
            combined       900 i/100ms
-------------------------------------------------
               assoc     9674.3 (±3.3%) i/s -      48840 in   5.054022s
              reader  2988474.8 (±6.9%) i/s -   14842236 in   4.998230s
            combined     9674.0 (±3.1%) i/s -      48600 in   5.028694s
bfc776f
@fxn fxn implements new option :month_format_string for date select helpers [C…
…loses #13618]
5f295ae
@arunagw arunagw Revert "Fixed plugin_generator test"
This reverts commit fefa8ae.
5f07366
@carlosantoniodasilva carlosantoniodasilva Merge pull request #14069 from arunagw/aa-plugin-generator-build-fix
Revert "Fixed plugin_generator test"

As this commit  22a1a5a has reverted all changes so this plugin generator also needs to fix.
4914adc
@robin850 robin850 Add a missing changelog entry for #13981 and #14035
[ci skip]
0c63fbc
@Fortisque Fortisque Correct prestreaming controller response status.
if the controller action has not yet streamed any data, actions should
process as normal, and errors should trigger the appropriate behavior
(500, or in the case of ActionController::BadRequest, a 400 Bad Request)
8508346
@rafaelfranca rafaelfranca Merge pull request #14072 from robin850/patch-16
Add a missing changelog entry for #13981 and #14035
8b80e3c
Commits on Feb 16, 2014
@vijaydev vijaydev Merge pull request #13937 from ktaragorn/guides_fixes
Guides fixes
3e3ed1e
@inopinatus inopinatus Resolve encoding issues with arrays of hstore (bug 11135).
We didn't have enough encoding for the wire protocol to store an array
of hstore types. So, further encode any hstore that is an array member.
Whilst we're here, ensure it's an HashWithIndifferentAccess being
returned, to be consistent with other serialized forms, and add testing
for arrays of hstore.

So now the following migration:

  enable_extension "hstore"
  create_table :servers do |t|
    t.string  :name
    t.hstore  :interfaces, array: true
  end

produces a model that can used like this, to store an array of hashes:

  server = Server.create(name: "server01", interfaces: [
    { name: "bge0", ipv4: "192.0.2.2", state: "up" },
    { name: "de0", state: "disabled", by: "misha" },
    { name: "fe0", state: "up" },
  ])

More at http://inopinatus.org/2013/07/12/using-arrays-of-hstore-with-rails-4/
da3fec2
@guilleiguaran guilleiguaran Merge pull request #13512 from gsamokovarov/hstore_arrays_fix
Hstore arrays fix (follow up for #11444)
7c32db1
Commits on Feb 17, 2014
@rafaelfranca rafaelfranca Fix typo [ci skip] 99cdad6
@rafaelfranca rafaelfranca Don't skip tests if they are not broken. Just don't define they 141313c
@rafaelfranca rafaelfranca No need to use symbols c507f9f
@rafaelfranca rafaelfranca Revert "Merge pull request #13344 from ccutrer/fix-from-default-select"
This reverts commit 3ea8403, reversing
changes made to e4cde5d.

Conflicts:
	activerecord/CHANGELOG.md
	activerecord/lib/active_record/relation/query_methods.rb

Reason: using `from` without `select` should not change the select list
to SELECT * because it can lead different query results. If it is needed
to change the table to a subquery or a view you can pass a table alias
in the `from` call or use `select('subquery.*')`.

Fixes #14049.
a2075f4
@carlosantoniodasilva carlosantoniodasilva Merge pull request #14087 from 10io/patch-1
Fix coffeescript sample [ci skip]
c18e7ab
Commits on Feb 18, 2014
@tenderlove tenderlove Merge pull request #14000 from Fortisque/kevin/stream_error_management
streaming should change status of response when exception is caught
f430836
@fxn fxn time helpers honor the application time zone when passed a date
Rails applications are expected to be always aware of the application
time zone.

To be consistent with that contract, we have to assume that a bare
date passed to time helpers is a date in the application time zone,
not in the system time zone. The system time zone is irrelevant, we
should totally ignore it.

For example,

    travel_to user.birth_date + 40.years

should make that user be 40th years old regardless of the system
time zone. Without this patch that may not be true.
65a7c57
@fxn fxn adds a missing travel back 24fa399
@fxn fxn travel_to travels back and re-raises if the block raises 5d03781
@raysrashmi raysrashmi Updated doc for default scope [ci skip] a8a7654
@rafaelfranca rafaelfranca Tell default_scope are prepended [ci skip] 56c8242
@kalabiyau kalabiyau Fix parameter naming in RemoteIp middleware constructor method
Was custom_proxies in inline docs, but should be and defined in
constructor as custom_proxies
4e84e12
@rafaelfranca rafaelfranca Aesthetic [ci skip] 28a0dd4
@arthurnn arthurnn Doc: assets:precompile:all was removed on 4 [skip ci] 4921d39
@dhh dhh Added Object#present_in to simplify value whitelisting 4edca10
@guilleiguaran guilleiguaran Merge pull request #14096 from arthurnn/precompile_all
Upgrade Doc: assets:precompile:all was removed on 4
8c4ca89
@dhh dhh Use assert_nil instead as its clearer about what the return is expect…
…ed to be
36bf5ac
@carlosantoniodasilva carlosantoniodasilva Minor grammar/punctuation fixes [ci skip] 76fec33
@carlosantoniodasilva carlosantoniodasilva Move changelog entry to the top, fix examples indent [ci skip] 68345d4
@carlosantoniodasilva carlosantoniodasilva Merge pull request #14094 from kalabiyau/fix_parameters_naming
Fix parameter naming in RemoteIp middleware constructor method [ci skip]
67e57ea
@rafaelfranca rafaelfranca Document the default scopes change on the release notes, CHANGELOG
and upgrating guides

[ci skip]
6370e69
@rafaelfranca rafaelfranca Fix the column name [ci skip] 967a6dc
@rafaelfranca rafaelfranca Don't use `# =>` when it is not the expression values
[ci skip]
fc641a1
@rafaelfranca rafaelfranca Merge pull request #14095 from rails/rm-scopes
Document `default_scope` changes
6c496a6
@sikachu sikachu Introduce `render :body` for render raw content
This is an option for sending a raw content back to browser. Note that
this rendering option will unset the default content type and does not
include "Content-Type" header back in the response.

You should only use this option if you are expecting the "Content-Type"
header to not be set. More information on "Content-Type" header can be
found on RFC 2616, section 7.2.1.

Please see #12374 for more detail.
103e18c
@sikachu sikachu Update hash format for render_text_test 9e9cc66
@sikachu sikachu Introduce `render :plain` for render plain text
This is as an option to render content with a content type of
`text/plain`. This is the preferred option if you are planning to render
a plain text content.

Please see #12374 for more detail.
8cd9f6d
@sikachu sikachu Introduce `render :html` for render HTML string
This is an option for to HTML content with a content type of
`text/html`. This rendering option calls `ERB::Util.html_escape`
internally to escape unsafe HTML string, so you will have to mark your
string as html safe if you have any HTML tag in it.

Please see #12374 for more detail.
920f3ba
@sikachu sikachu Fix a fragile test on `action_view/render`
This test were assuming that the list of render options will always be
the same. Fixing that so this doesn't break when we add/remove render
option in the future.
243e6e4
@sikachu sikachu Cleanup `ActionController::Rendering` 79c4983
@sikachu sikachu Update guides for new rendering options
* Introduces `:plain`, `:html`, `:body` render option.
* Update guide to use `render :plain` instead of `render :text`.
76be30f
@sikachu sikachu Add missing CHANGELOG entry to Action View 9fe506e
@sikachu sikachu Add `#no_content_type` attribute to `AD::Response`
Setting this attribute to `true` will remove the content type header
from the request. This is use in `render :body` feature.
3047376
@sikachu sikachu Update upgrading guide regarding `render :text` ede0f8c
@rafaelfranca rafaelfranca Merge pull request #14062 from sikachu/ps-render-format
Introduce `:plain`, `:html`, and `:body` render options.
acc0e63
@chancancode chancancode Sync 4.1 release notes with changes since 7f648bc [ci skip] 578839b
@chancancode chancancode Merge pull request #14097 from chancancode/sync_4_1_release_notes
Sync 4.1 release notes with changes since 7f648bc
4f23760
@rafaelfranca rafaelfranca Escape format, negative_format and units options of number helpers
Previously the values of these options were trusted leading to
potential XSS vulnerabilities.

Fixes: CVE-2014-0081
08d0a11
@tenderlove tenderlove Correctly escape PostgreSQL arrays.
Thanks Godfrey Chan for reporting this!

Fixes: CVE-2014-0080
6256b1d
@rafaelfranca rafaelfranca Preparing for 4.1.0.beta2 release 8b20c72
@rafaelfranca rafaelfranca Merge branch '4-1-0-beta2'
Conflicts:
	actionview/CHANGELOG.md
	activerecord/CHANGELOG.md
1879c25
@rafaelfranca rafaelfranca Use the reference for the mime type to get the format
Before we were calling to_sym in the mime type, even when it is unknown
what can cause denial of service since symbols are not removed by the
garbage collector.

Fixes: CVE-2014-0082
33cb47e
@Amit-Thawait Amit-Thawait Typo fix for unscope b74490e
@arthurnn arthurnn Merge pull request #14098 from Amit-Thawait/master
Typo fix for unscope [ci skip]
5dc6bf5
@robertomiranda robertomiranda Update Docs in favor to use render plain instead of text option
ref #14062
e220a34
@guilleiguaran guilleiguaran Merge pull request #14099 from robertomiranda/render-text-2-plain
Update Docs in favor to use render plain instead of text option
11645ad
@guilleiguaran guilleiguaran Fix render plain docs example in AM::Base
The errors were introduced in e220a34
1c248df
Commits on Feb 19, 2014
@prakashmurthy prakashmurthy [ci skip] Close the meta tag with '/>' instead of '>'
This change fixes the 42 instances of `end tag for "meta" omitted, but
OMITTAG NO was specified` error message that comes up when the full
railsguides are validated.

Full error list at
https://gist.github.com/prakashmurthy/9086679.
9b3be63
@arunagw arunagw Merge pull request #14107 from prakashmurthy/patch-1
Close the meta tag with '/>' instead of '>'
a0d63c3
@arthurnn arthurnn Methods silence_stream/quietly are not thread-safe [skip ci]
State that on the doc.

[fixes #11954]
7a025b1
@fxn fxn Merge pull request #14102 from arthurnn/quietly_doc
Add note to silence_stream and quietly. [skip ci]
a26394d
@arunagw arunagw Pointing to latest guides [ci skip] 25ce856
Commits on Feb 20, 2014
@gregmolnar gregmolnar change 'assert !' to 'assert_not' in guides [ci skip] fa8d35b
@carlosantoniodasilva carlosantoniodasilva Merge pull request #14120 from gregmolnar/guides
change 'assert !' to 'assert_not' in guides [ci skip]
1774618
@arthurnn arthurnn Revert "speed up the collection proxy reader method, but slow down th…
…e constructor"

This reverts commit f9e4c3c.

[fixes #14116]
d038a72
@arthurnn arthurnn Add regression test for collection proxy reader
[related #14116]
f96831e
@jingweno jingweno [skip ci] Fix the javascript path in guide for asset modules b7aeab6
@vijaydev vijaydev Merge branch 'master' of github.com:rails/docrails b078f5e
@tenderlove tenderlove Merge pull request #14124 from arthurnn/fix_14116
Fix collection proxy exists? regression
e5a6e6f
@arthurnn arthurnn Merge pull request #14086 from jingweno/master
Fix the javascript path in guide for asset modules [skip ci]
9e4c1ab
@joankaradimov joankaradimov Check if the `request` variable isn't nil when calling render_to_string
closes #14125
f6d9b68
@carlosantoniodasilva carlosantoniodasilva Merge pull request #14129 from joankaradimov/fix-render-to-string
Fix `render_to_string` when called via manually instantiated controllers
53d7b2f
@tenderlove tenderlove Revert "context in validation goes through has many relationship"
This reverts commit 5e3d466.
358802b
@tenderlove tenderlove adding a test for #14106 7eaebd8
@kuldeepaggarwal kuldeepaggarwal [ci skip] update guides to new version of rails 3.2.x 5ce58db
@arthurnn arthurnn Merge pull request #14131 from kuldeepaggarwal/upgrade-rails-version
update guides to new version of rails 3.2.x, i.e. 3.2.17 [skip ci]
020c783
@fxn fxn releasing Rails no longer needs triggering docs generation by hand [c…
…i skip]

GitHub is now able to notify tag creation, I have configured the webhook
for the docs server to receive that event. Therefore, we no longer need
to trigger docs generation manually when releasing.
c93c558
Commits on Feb 21, 2014
@WojtekKruszewski WojtekKruszewski Prevent foreign_key_for? from type casting all attributes dbf9ec0
@guilleiguaran guilleiguaran Revert "Only lookup `config.log_level` for stdlib `::Logger`. Closes #…
…11665."

This reverts commit e0a521c.

Conflicts:
	railties/CHANGELOG.md

We expect loggers to quack like stdlib logger. If log4r needs different
level= assignment, using a Logger-quacking wrapper is the way to do it.

Fixes #14114.
b1867c8
@carlosantoniodasilva carlosantoniodasilva Merge pull request #14140 from WojtekKruszewski/optimize_foreign_key_for
Prevent foreign_key_for? from evaluating all attributes
467cb90
Commits on Feb 22, 2014
@jeremy jeremy Distinguish ConnectionNotEstablished messages: no conn pool for the c…
…lass, or no conn available from the pool
58ba48e
Commits on Feb 23, 2014
@vajrasky vajrasky Fixed typo in comment about MAX_ID. 5ea67a2
@guilleiguaran guilleiguaran Merge pull request #14164 from vajrasky/fix_typo_max_id
Fixed typo in comment about MAX_ID.
624f855
@kuldeepaggarwal kuldeepaggarwal Add warning when user tried to create model with pluralize name.
  1. Generate model with correct_name.
  2. It will help new users to avoid mistakes when tried to create model with wrong name.
de8bef9
@chancancode chancancode Merge pull request #13515 from kuldeepaggarwal/f-model-generation
Added warning when user tried to create model with pluralize name.
f8dcc48