Commit Graph

36951 Commits

Author SHA1 Message Date
Vipul A M
afdf279e2f refactor order hash test 2013-04-11 21:55:45 +05:30
Xavier Noria
2e3f5191f0 fixes app_rails_loader_test.rb in Mac OS X 2013-04-11 15:22:59 +02:00
Carlos Antonio da Silva
8bb8ba127b Merge pull request #10174 from vipulnsward/cleanup_caching_test
Cleanup statement cache test
2013-04-11 05:46:04 -07:00
Vipul A M
127a2eea63 cleanup statement cache test 2013-04-11 18:08:46 +05:30
Xavier Noria
f64ba8782e fixes remaining lowercase "rails" 2013-04-11 13:28:57 +02:00
Xavier Noria
85de183071 application loader refactor and test suite complete rewrite 2013-04-11 13:19:16 +02:00
Carlos Antonio da Silva
2a07db7169 Remove warning
warning: `*' interpreted as argument prefix
2013-04-10 21:09:45 -03:00
Carlos Antonio da Silva
c0163cc5f2 Merge pull request #10170 from rubys/editorial_pass_over_generated_gemfile
Editorial pass over generated Gemfile
2013-04-10 16:44:51 -07:00
Sam Ruby
0171c475f2 Editorial pass over generated Gemfile
* When run with default options, no repeated blank lines
* Every gem has a comment, perhaps a generic one, but a comment nonetheless
* Most comments used to start with "Use", some with "To use" => made consistent
2013-04-10 19:33:42 -04:00
Rafael Mendonça França
0235cdf5ce Merge pull request #10152 from Noemj/statement_cache
Statement cache

Conflicts:
	activerecord/CHANGELOG.md
2013-04-10 16:02:26 -03:00
Rafael Mendonça França
0b38c84332 Merge pull request #10168 from neerajdotname/simple_improvements
Simple improvements
2013-04-10 11:39:13 -07:00
Neeraj Singh
aeafc09921 converge three lines into one 2013-04-10 14:34:03 -04:00
Neeraj Singh
070dda28ae rdoc for some of the methods in JoinDependency 2013-04-10 14:33:39 -04:00
Neeraj Singh
eb750e2127 remove_duplicate_results! should be protected 2013-04-10 14:33:20 -04:00
Rafael Mendonça França
9d2146ac6e Revert "Merge pull request #6226 from gnufied/master"
This reverts commit 9bf1a0db4acbbf9e8e6f707250269185224e7efe, reversing
changes made to fed97091b9546d369a240d10b184793d49247dd3.

Conflicts:
	activerecord/test/cases/transaction_callbacks_test.rb

Reason: This fix introduces another issue described at #8937, so we are
reverting it to restore the behavior of 3-2-stable.

We will fix both issues when we come out with a better solution
2013-04-10 15:21:07 -03:00
Noemj
af1a4bdc56 Added statement cache 2013-04-10 21:20:58 +03:00
Rafael Mendonça França
8c883855b4 Merge pull request #10164 from neerajdotname/3002-final
While merging relations preserve context for joins
2013-04-10 09:24:37 -07:00
Jared Armstrong and Neeraj Singh
dc764fcc34 While merging relations preserve context for joins
Fixes #3002. Also see #5494.

```
class Comment < ActiveRecord::Base
  belongs_to :post
end

class Author < ActiveRecord::Base
  has_many :posts
end

class Post < ActiveRecord::Base
  belongs_to :author
  has_many :comments
end
```

`Comment.joins(:post).merge(Post.joins(:author).merge(Author.where(:name => "Joe Blogs"))).all` would
fail with `ActiveRecord::ConfigurationError: Association named 'author' was not found on Comment`.

It is failing because `all` is being called on relation which looks like this after all the merging:
`{:joins=>[:post, :author], :where=>[#<Arel::Nodes::Equality: ....}`. In this relation all the context that
`Post` was joined with `Author` is lost and hence the error that `author` was not found on `Comment`.

Ths solution is to build JoinAssociation when two relations with join information are being merged. And later
while building the arel use the  previously built `JoinAssociation` record in `JoinDependency#graft` to
build the right from clause.

Thanks to Jared Armstrong (https://github.com/armstrjare) for most of the work. I ported it to make it
compatible with new code base.
2013-04-10 12:19:47 -04:00
Rafael Mendonça França
d716fe05df Revert "Merge pull request #10158 from steveklabnik/issue_10125"
This reverts commit fa3ef8e82ab2f96cf15ef9bc885b2468fad77621, reversing
changes made to e0af93dd3a5eeee2e2a67b05f34afb66cc80c00b.

Reason: Routes, Active Record and the rendering stack should not depend
on the default locale
2013-04-10 12:44:39 -03:00
Xavier Noria
4041068125 code review of 22e5ab3 2013-04-10 17:42:00 +02:00
Xavier Noria
1c67ecca05 Merge pull request #10157 from prathamesh-sonpatki/app_loader
Searching for rails executable correctly
2013-04-10 08:26:56 -07:00
Prathamesh Sonpatki
22e5ab31b5 Searching for rails executable correctly
* Current logic of finding Rails executable in parent directory is
   not returning full path of executable if it is found in one of the
   parent directories
 * To compensate for this, we have to call exec_app_rails recursively
   until the executable is found or we cant do 'chdir' anymore
 * This solution finds the correct executable path from parent
   directory(s) recursively
2013-04-10 20:52:33 +05:30
Rafael Mendonça França
4658b0d48c Merge pull request #10165 from wangjohn/public_send_for_instance
Using public send instead of send for the PerThreadRegistry module.
2013-04-10 07:16:03 -07:00
wangjohn
60a5ac78b0 Using public send instead of send for the PerThreadRegistry module.
Prevents you from accidentally calling a protected method.
2013-04-10 09:56:40 -04:00
Carlos Antonio da Silva
bb61d2defa Merge pull request #10162 from choudhuryanupam/fix_activesupport_test
Removed unused setup
2013-04-10 04:31:51 -07:00
Anupam Choudhury
ea4cb5d1f3 Removed unused setup 2013-04-10 16:57:12 +05:30
Xavier Noria
c14ce51402 Merge pull request #10160 from choudhuryanupam/fix_typo_n_grammar
Fixed typo
2013-04-10 02:49:30 -07:00
Anupam Choudhury
975234c680 Fixed typo 2013-04-10 15:13:10 +05:30
Andrew White
24b1d4fc63 Return nil for Mime::NullType#ref 2013-04-10 08:18:06 +01:00
Grzegorz Świrski
d50df2f116 Reverts rendering behavior when format is unknown
If a request has unknown format (eg. /foo.bar), the renderer
fallbacks to default format.

This patch reverts Rails 3.2 behavior after c2267db commit.

Fixes issue #9654.
2013-04-10 08:13:16 +01:00
Andrew White
17a886b275 Add failing test case for #9654 2013-04-10 08:11:43 +01:00
Steve Klabnik
fa3ef8e82a Merge pull request #10158 from steveklabnik/issue_10125
Fix inflector to respect default locale.
2013-04-09 21:43:00 -07:00
Jeremy Kemper
e0af93dd3a Merge pull request #10156 from wangjohn/grouping_thread_locals
Grouping thread locals in ActiveRecord
2013-04-09 21:27:48 -07:00
Nick Cox
8cf88cc75a Fix inflector to respect default locale.
The inflector was made aware of locales in 7db0b073fec6bc3e6f213b58c76e7f43fcc2ab97,
but it defaulted to :en. That should actually be our default
locale instead.

Fixes #10125
2013-04-10 04:22:34 +00:00
wangjohn
e12901e423 Changed the ScopeRegistry and the InstrumentationRegistry to use the
PerThreadRegistry module.
2013-04-09 22:27:32 -04:00
wangjohn
95ac3913ee Created a runtime registry for thread local variables in active record. 2013-04-09 22:27:32 -04:00
wangjohn
e94f024e14 Creating a module so that per thread registries can be easily created as
thread local variables.
2013-04-09 22:27:21 -04:00
Jeremy Kemper
9039c50388 Explain how to upgrade bin/ for Rails 4 2013-04-09 16:49:24 -07:00
Carlos Antonio da Silva
74be6bba9e Merge pull request #10154 from killthekitten/fix_template_error_header
Use camelize instead of capitalize on template error screen
2013-04-09 16:11:30 -07:00
Steve Klabnik
f4e4ba828d Merge pull request #10103 from senny/get_action_mailer_guide_ready_for_prime_time
Get Action Mailer guide ready for prime time [ci skip]
2013-04-09 15:41:51 -07:00
Nikolay Shebanov
908ee27b8e Use camelize instead of capitalize on error screen 2013-04-10 02:26:02 +04:00
Xavier Noria
e79d2c8aa6 copy-edit pass in AM changelog [ci skip] 2013-04-09 22:41:03 +02:00
Yves Senn
d4ae49b058 get the Action Mailer guide ready. [ci skip] 2013-04-09 20:06:46 +02:00
Rafael Mendonça França
ee889510f8 Merge pull request #9843 from indirect/rails_bin
Rails 4 prints help for "rails new" when running "rails console"
2013-04-09 09:24:48 -07:00
Rafael Mendonça França
5654b0a27e Fix typo 2013-04-09 13:00:45 -03:00
Rafael Mendonça França
d6d69f863f Merge pull request #10153 from choudhuryanupam/master
Removed unused setup
2013-04-09 08:49:52 -07:00
Anupam Choudhury
e000aa92dd Removed unused setup 2013-04-09 20:57:55 +05:30
Rafael Mendonça França
a74d84bb29 Merge pull request #10142 from wangjohn/grouping_thread_locals
Delegating the value getter and setters in the ScopeRegistry
2013-04-09 07:19:29 -07:00
Rafael Mendonça França
821d7bd847 Merge pull request #10151 from neerajdotname/ar-to-klass
changed variable name active_record => base_klass
2013-04-09 06:50:14 -07:00
Neeraj Singh
d87966c1c4 changed variable name active_record => base_klass
Current code stores the klass name in active_record and this
is used throughout. While reviewing the code time and again
I had the mental picture of active_record being an instance of
a klass. However here the actual klass is being stored in
@active_record.

Secondly at two different places while referring to @active_record
the comment refers to it as base klass. All this points to
active_record being not the best variable name.

So I thought it is better to replace active_record with base_klass.

This change is confined to JoinDependency, JoinBase, JoinPart and
JoinAssociation - all joining related work.
2013-04-09 08:53:10 -04:00