Commit Graph

32396 Commits

Author SHA1 Message Date
David Heinemeier Hansson
ed5c938fa3 Added controller-level etag additions that will be part of the action etag computation *Jeremy Kemper/DHH* 2012-08-29 15:06:30 -05:00
David Heinemeier Hansson
502d5e24e2 Add automatic template digests to all CacheHelper#cache calls (originally spiked in the cache_digests plugin) *DHH* 2012-08-29 14:23:56 -05:00
David Heinemeier Hansson
3da10e3261 Fix spacing 2012-08-29 14:23:27 -05:00
David Heinemeier Hansson
d3354957fc Fix spacing 2012-08-29 14:23:27 -05:00
Andrew White
46d85438fe Merge pull request #7230 from schneems/schneems/expose_required_keys
Add Missing Keys from Journey on Failed URL Format
2012-08-29 12:03:06 -07:00
Xavier Noria
3b2c42cb56 fixes a regexp
We need to anchor to remove the extension. In addition to
be the correct way to do that, files in ~/.rbenv get that
.rb removed, so it is a real source of bugs, as reported in

b33700f558 (commitcomment-1781840)
2012-08-29 17:42:43 +02:00
Xavier Noria
8e974f2e3c Merge pull request #7476 from ayrton/fixed_indentation
Fixed indendation
2012-08-29 01:39:34 -07:00
Ayrton De Craene
8d9f9f9dfb Fixed indendation 2012-08-29 10:25:36 +02:00
Pratik Naik
754173c5ff Add a test to make sure preloading properly merges association and default scope conditions 2012-08-28 12:49:55 -07:00
Xavier Noria
810a50dacf CHANGELOGs are now per branch
Changes in old branches needed to be manually synched in CHANGELOGs of newer ones.
This has proven to be brittle, sometimes one just forgets this manual step.
With this commit we switch to CHANGELOGs per branch. When a new major version is
cut from master, the CHANGELOGs in master start being blank.

A link to the CHANGELOG of the previous branch allows anyone interested to
follow the history.
2012-08-28 21:15:16 +02:00
Xavier Noria
b33700f558 detect circular constant autoloading
Nowadays circular autoloads do not work, but the user gets a NameError
that says some constant is undefined. That's puzzling, because he is
normally trying to autoload a constant he knows can be autoloaded.
With this check we can give a better error message.
2012-08-28 20:34:39 +02:00
Rafael Mendonça França
844e944465 Merge pull request #7470 from kennyj/fix_method_redefined_warning
Fix method redefined warnings.
2012-08-28 10:40:29 -07:00
kennyj
9063f3729b Fix method redefined warnings. 2012-08-29 02:38:12 +09:00
José Valim
1ef9b7ec78 Merge pull request #7469 from kennyj/fix_many_warnings_in_am
Fixes warnings when executing rake test in ActionMailer.
2012-08-28 10:05:55 -07:00
kennyj
167f250d98 Fixes warnings when executing rake test in ActionMailer. Related to 582a7f459990487659886b90e54c22e055c65870 2012-08-29 01:57:44 +09:00
José Valim
52c0bf9843 Merge pull request #7468 from kennyj/tiny_fixings
Tiny fixes in railties/test/application.
2012-08-28 09:32:24 -07:00
kennyj
1006382655 Remove unused require. 2012-08-29 01:22:06 +09:00
kennyj
f686bc85b7 Fixes wrong test class names. 2012-08-29 01:21:43 +09:00
schneems
cc57b2a422 refactor route_set generate_extras functionality
The result of Generator with or without the @extras instance variable set contains the desired information. Rather than preserving state when initializing the original object, we can simply extract the keys from the resultant parameters.

ATP Actionpack, railties
2012-08-28 08:53:45 -07:00
schneems
0b6175ac2d Add Missing Keys from Journey on failed URL format
Many named routes have keys that are required to successfully resolve. If a key is left off like this:

    <%= link_to 'user', user_path %>

This will produce an error like this:

    No route matches {:action=>"show", :controller=>"users"}

Since we know that the :id is missing, we can add extra debugging information to the error message.

    No route matches {:action=>"show", :controller=>"users"} missing required keys: [:id]


This will help new and seasoned developers look closer at their parameters. I've also subclassed the routing error to be clear that this error is a result of attempting to generate a url and not because the user is trying to visit a bad url. 

While this may sound trivial this error message is misleading and confuses most developers. The important part isn't what's in the options its's what's missing. Adding this information to the error message will make debugging much more obvious. 

This is the sister pull request of https://github.com/rails/journey/pull/44 which will be required to get they missing keys into the correct error message. 

Example Development Error in Rails: http://cl.ly/image/3S0T0n1T3421
2012-08-28 08:53:45 -07:00
Xavier Noria
db8ff15a49 fixes a bug in dependencies.rb
loaded stores file names without the .rb extension, but search_for_file
returns file names with the extension.

The solution is hackish, but this file needs a revamp.
2012-08-28 17:19:39 +02:00
Rafael Mendonça França
265c8b771d Merge pull request #7466 from arunagw/warning_removed_ap
removed :  warning: `*' interpreted as argument prefix
2012-08-28 07:50:01 -07:00
Arun Agrawal
72bcd9edf8 removed : warning: `*' interpreted as argument prefix 2012-08-28 20:13:36 +05:30
Rafael Mendonça França
e4b33b08d6 Add missing require 2012-08-28 10:12:49 -03:00
Rafael Mendonça França
7256cb53e0 Merge pull request #7452 from arunagw/memcached_dalli
Memcached to dalli for actionpack test.
2012-08-28 05:27:34 -07:00
José Valim
6ebe22c3ae Merge pull request #7465 from wpp/generator_controller_plural
Change generators controller help from singular to plural example.
2012-08-28 05:24:06 -07:00
Philipp Weissensteiner
8102c0d9ed Change generators controller help from singular to plural example.
When running `rails generate controller --help` an example
with creating a (singular) "CreditCard" controller is
shown. The convention is to generate controllers with plural
names though.
2012-08-28 14:01:20 +02:00
Rafael Mendonça França
114463305f Merge pull request #7458 from frodsan/fix_orddep_basics
fix order dependent test in AR::BasicsTest
2012-08-28 04:55:33 -07:00
Piotr Sarnacki
4f093d81ac Merge branch 'actionview-decoupling'
This branch contains set of changes that will allow to extract Action
View out of Action Pack in the future. This work will be probably done
after Rails 4.0 release, because of a few deprecations that were done
to make decoupling possible.
2012-08-28 11:24:29 +02:00
Piotr Sarnacki
daa0ed3af2 Update AP's CHANGELOG with user facing changes 2012-08-28 11:19:37 +02:00
Piotr Sarnacki
e1ffd82e76 Deprecate AV::RecordIdentifier in controllers
Methods provided by RecordIdentifier are not widely used in controllers
nowadays as they're view specific (this is probably a legacy left after
RJS rendering directly in controllers). However if people still need to
use it, it's trivial to include ActionView::RecordIdentifier by
themselves.
2012-08-28 11:19:37 +02:00
Piotr Sarnacki
f4d493ed7c Fix ActionView::RecordIdentifier to work as a singleton
We extend it with self, but the methods were not working properly were
used directly on module.
2012-08-28 11:19:37 +02:00
Piotr Sarnacki
8eb4600c88 No need to use included hook for include
When module is extended ActiveSupport::Concern, include calls are lazily
loaded, so there is no need to wrap it with included hook.
2012-08-28 11:19:36 +02:00
Piotr Sarnacki
582a7f4599 Deprecate Template#mime_type 2012-08-28 11:19:36 +02:00
Piotr Sarnacki
3fb10fd479 Add deprecation horizon to html-scanner 2012-08-28 11:19:36 +02:00
Piotr Sarnacki
67f55e2822 Implement ActionView::Template::Types
AV::Template::Types is a small abstraction to allow to specify template types
that can be used in ActionView. When Action Pack is loaded it's replaced with
Mime::Type.
2012-08-28 11:19:36 +02:00
Piotr Sarnacki
dc663dd52c Don't require action_dispatch in ActionView::UrlHelpers
ActionDispatch::Routing::UrlFor was always required in UrlHelpers. This
was changed by splitting previous implementation of UrlHelper into 2
modules: ActionView::Helpers::UrlHelper and
ActionView::Routing::UrlHelper. The former one keeps only basic
implementation of url_for. The latter adds features that allow to use
routes and is only required when url_helpers or mounted_helpers are
required.
2012-08-28 11:19:29 +02:00
Piotr Sarnacki
9b0ac0bc74 Use ActionView::Base.logger instead of AC::Base.logger 2012-08-28 10:51:05 +02:00
Piotr Sarnacki
45efb665f0 Add ActionView::Base.default_formats
default_formats array is used by LookupContext in order to allow
rendering templates when :formats option is not passed. Previously it
was always set to Mime::SET, which created dependency on Action Pack. In
order to remove this dependency, Mime::SET is used only if
ActionController is loaded.
2012-08-28 10:51:04 +02:00
Piotr Sarnacki
f21a528f55 Remove Mime::Type translations from Action View
Action View should not be responsible for translating mime types. Any
translation that's needed should be handled at controller level.
2012-08-28 10:51:04 +02:00
Piotr Sarnacki
7abc0c73bd Deprecate mime types lookup in auto_discovery_link_tag
Automatically handling mime types for things other than :rss and :atom
is not functionality that justifies dependency on Mime::Type from
actionpack.
2012-08-28 10:51:04 +02:00
Piotr Sarnacki
9e731f0d8a Remove comment about getting rid of old AV::Base.new behavior
I've talked to José Valim, who added this comment, and there is no need
to remove old API. It's good to have a simple way to instantiate
ActionView::Base, by just passing view paths as a first argument,
instead of constructing LookupContext and then the Renderer.

[ci skip]
2012-08-28 10:51:04 +02:00
Piotr Sarnacki
731bb2fe68 Remove stubs from LogSubscriber tests
We can use another way to instantiate ActionView::Base, by passing
renderer as a first option. Thanks to that we can just pass prefixes to
LookupContext instead stubbing them on the controller. This is also good,
because that kind of API is used in Rails code.
2012-08-28 10:51:04 +02:00
Piotr Sarnacki
ba83aa7f03 Move action_controller/vendor/html-scanner to action_view
This is another step in moving Action View's dependencies in Action Pack
to Action View itself. Also, HtmlScanner seems to be better suited for
views rather than controllers.
2012-08-28 10:51:03 +02:00
Piotr Sarnacki
4efad291c1 Deprecate ActionController::RecordIdentifier 2012-08-28 10:51:03 +02:00
Piotr Sarnacki
8ca17926dc Add ActionView::ModelNaming
It's just a duplicate of ActionController::ModelNaming. These are just a
simple helpers for decoupling Active Model, so it does not make sense to
extract it to Active Support, but the point is to decouple also Action
View and Action Pack
2012-08-28 10:51:03 +02:00
Piotr Sarnacki
264624049e Move ActionController::RecordIdentifier to ActionView
Since it's more about DOM classes and ids it belongs to Action View
better. What's more, it's more convenient to make it part of Action View
to follow the rule that Action Pack can depend on Action View, but not
the other way round.
2012-08-28 10:51:03 +02:00
Piotr Sarnacki
7185e35971 Remove dependency on actionpack in ActionView::AssetPaths
Since Action View should not depend on actionpack, it's best to delegate
invalid_asset_host! to controller and just rely on such simple contract
instead of raising ActionController::RoutingError directly.
2012-08-28 10:51:03 +02:00
Rafael Mendonça França
1ec1eb2ff2 Merge pull request #7460 from frodsan/fix_nested_attributes_test
ensures that the test repairs the validation setup
2012-08-27 14:48:08 -07:00
Francesco Rodriguez
206d9a7490 ensures that the test repairs the validation setup 2012-08-27 16:46:36 -05:00