Commit Graph

52444 Commits

Author SHA1 Message Date
Brooks Reese
c939bb7e8a [ci skip] Modify introduction text and bullets to be consistent with other guides 2015-08-10 09:49:28 -05:00
Yves Senn
8d70f40da5 docs, use hash instead of a string for order. [ci skip]
Closes #21121
2015-08-10 09:18:56 +02:00
Kasper Timm Hansen
a0fa45c0e6 Merge pull request #21124 from kirs/feature/reload-i18n
Reload I18n.load_path in development
2015-08-10 07:34:13 +02:00
Rafael Mendonça França
67b07f809b Update Gemfile.lock 2015-08-10 00:30:03 -03:00
Rafael Mendonça França
6e6cfb665a Merge pull request #21176 from y-yagi/fix_scaffold_tests_inside_api_engine
make generated scaffold functional tests work inside API engines
2015-08-09 23:50:27 -03:00
Rafael Mendonça França
8d0c107a60 Remove wrong comment
This method raises conditionally not always so we should not documment
as it always raise.
2015-08-09 23:30:08 -03:00
Rafael Mendonça França
09e1689252 Remove the conditional since it is done in the method 2015-08-09 23:27:40 -03:00
Rafael Mendonça França
20cf2dd089 Execute the block when the controller doesn't exist
We should return when the contoller key is not present or if the
controller doesn't exist and we didn't raised an error.
2015-08-09 23:15:35 -03:00
Rafael Mendonça França
4818fdd36b Name the argument according with its job
Related with dc1b937db780155089fce522f03d340e62f5df36
2015-08-09 23:10:48 -03:00
Rafael Mendonça França
2ca686110c Whitespaces 2015-08-09 22:33:19 -03:00
Aaron Patterson
919e7d3e6c push scope calls up one frame
eliminates calling `scope` in one method, pushes the other calls up one
frame.  This goes a little way towards eliminating the internal calls to
`scope`.
2015-08-09 17:11:43 -07:00
Kir Shatrov
f50e90a1ae Reload I18n locales in development 2015-08-10 00:17:49 +02:00
Claudio B.
644c4efdc9 Merge pull request #21177 from brooksreese/single_crud_operation
[ci skip] Note that each action maps to a specific CRUD operation
2015-08-09 11:12:03 -07:00
Brooks Reese
0082ffeff1 [ci skip] Note that each action maps to a specific CRUD operation 2015-08-09 11:16:20 -05:00
yuuji.yaginuma
22d863d272 make generated scaffold functional tests work inside API engines
* set engine's route in setup
* use fixture with engine namespace
2015-08-09 21:32:39 +09:00
Aaron Patterson
378e3a666e remove useless hash
we don't really need this hash.
2015-08-08 18:57:47 -07:00
Aaron Patterson
f360689586 stop calling scope internally
we need to get a grip on what `scope` actually does.  This commit
removes some of the internal calls to `scope`.  Eventually we should add
public facing methods that provide the API that `scope` is trying to
accomplish.
2015-08-08 18:48:27 -07:00
Aaron Patterson
5a18b853ed remove useless conditional
`prepare_params!` would raise an exception if `params` wasn't
initialized, so it must always be available.  Remove the existence
conditional from the `controller` method.
2015-08-08 17:12:50 -07:00
Aaron Patterson
1b73d53a1c eliminate assignment in conditional
The method we called already has the conditional we need.  Just add an
else block so that we don't need two tests.
2015-08-08 16:39:16 -07:00
Aaron Patterson
dc1b937db7 Remove defaults hash from Dispatcher
`Dispatcher` doesn't need to hold on to the defaults hash.  It only used
the hash to determine whether or not it should raise an exception if
there is a name error.  We can pass that in further up the stack and
alleviate Dispatcher from knowing about that hash.
2015-08-08 16:34:34 -07:00
Aaron Patterson
175e92c9ac eliminate runtime conditional
We know in advance whether the object is a dispatcher or not, so we can
configure the Constraints object with a strategy that will call the
right method.
2015-08-08 16:12:00 -07:00
Aaron Patterson
246bfcb473 whitespace 2015-08-08 15:41:36 -07:00
Aaron Patterson
5e81e6ca31 remove the setter from Scope
it isn't used.
2015-08-08 15:04:20 -07:00
Richard Schneeman
aeaf32e1b3 Merge pull request #21175 from gringocl/middleware-deprecations
Reference actual classes
2015-08-08 16:48:11 -05:00
Claudio B.
6e21494ac6 Merge pull request #21173 from repinel/fix-callback-terminator-docs
[ci skip] Fix the AS::Callbacks terminator docs
2015-08-08 13:40:39 -07:00
Claudio B.
175d8acf43 Merge pull request #21166 from brooksreese/migration_seed_explanation
[ci skip] Give in-depth explanation of migrations vs. seeds.rb
2015-08-08 13:18:17 -07:00
Miles Starkenburg
468cdfcc85 Reference actual classes 2015-08-08 13:15:28 -07:00
Brooks Reese
4445e79157 [ci skip] Give in-depth explanation of migrations vs. seeds.rb 2015-08-08 14:37:21 -05:00
Rafael Mendonça França
60dbcbdcde Merge pull request #21174 from melissawahnish/document_gmail
[ci skip] Adding a note to Action Mailer Basics documentation that Google increased its security measures
2015-08-08 15:23:18 -03:00
melissawahnish
1896be9741 [ci skip] Adding a note to Action Mailer Basics documentation that Google increased its
security measures so using the example for Gmail will return a “Password Incorrect” error,
and you will receive an email from Google that they blocked a sign-in attempt.  You can change
your Gmail settings or use another ESP.

I discovered this when I was testing a simple mailer example app and was just going to
use my personal Gmail account for the test.  I think it would be best to note this change
since now Gmail may not be the best option for a quick test.  I hope this saves time for other Rails
developers.  The Gmail example does show a good example of how to configure the smpt settings.
2015-08-08 14:02:33 -04:00
Roque Pinel
6a17897178 [ci skip] Fix the AS::Callbacks terminator docs
The second argument of the terminator lambda is no longer the result
of the callback, but the result lambda.

3a7609e2ba/activesupport/test/callbacks_test.rb (L553)
2015-08-08 13:40:33 -04:00
Kasper Timm Hansen
3a7609e2ba Merge pull request #21167 from AaronLasseigne/use_each_key
replace each with each_key when only the key is needed
2015-08-08 18:56:10 +02:00
Aaron Lasseigne
725f9bf3e2 replace each with each_key when only the key is needed
Using each_key is faster and more intention revealing.

Calculating -------------------------------------
                each    31.378k i/100ms
            each_key    33.790k i/100ms
-------------------------------------------------
                each    450.225k (± 7.0%) i/s -      2.259M
            each_key    494.459k (± 6.3%) i/s -      2.467M

Comparison:
            each_key:   494459.4 i/s
                each:   450225.1 i/s - 1.10x slower
2015-08-08 11:54:09 -05:00
eileencodes
286cb890de Refactor route assertion methods in resources test
The tests and methods were hard to read with `options[:options]` all
over the place. This refactoring makes the code easier to understand.

The change came out of work for moving the underlying code of controller
tests to integraiton tests.
2015-08-08 11:53:05 -04:00
Rafael Mendonça França
d919fd88ec Merge pull request #11352 from xaviershay/dispatcher-api
Allow a custom dispatcher to be provided to routing.
2015-08-08 12:22:21 -03:00
eileencodes
12f08acbac Fix deprecation warning in tests
Using the string version of the class reference is now deprecated when
referencing middleware. This should be written as a class not as a string.

Deprecation warning that this change fixes:
```
DEPRECATION WARNING: Passing strings or symbols to the middleware
builder is deprecated, please change
them to actual class references.  For example:
  "ActionDispatch::ShowExceptions" => ActionDispatch::ShowExceptions
```
2015-08-08 10:38:09 -04:00
eileencodes
e7dd9069ca Rename extra_keys variables to query_string_keys
`extra_keys` is a confusing variable name because it's not clear what is
"extra". This renames it to `query_string_keys` so it's clear that the
"extra" is just the query string.
2015-08-08 10:29:34 -04:00
eileencodes
c8b8295583 Refactor to remove DrawOnce module
We were doing extra work that could be pushed off to Integration test
and SharedRoutes. Creating an extra module isn't necessary when those
are created by their respective classes.
2015-08-08 10:15:35 -04:00
Abdelkader Boudih
e7007e384c Merge pull request #21170 from y-yagi/fix_uuid_example
use uuid method to define the UUID type [ci skip]
2015-08-08 10:47:04 +01:00
yuuji.yaginuma
c0747e2f39 use uuid method to define the UUID type [ci skip] 2015-08-08 18:37:22 +09:00
Richard Schneeman
64b5c849a0 Merge pull request #21169 from yui-knk/doc/route_status
[ci skip] Add an explanation for `status` option
2015-08-07 23:13:05 -05:00
yui-knk
235155302e [ci skip] Add an explanation for status option 2015-08-08 12:27:55 +09:00
Xavier Shay
2992b1c04c Allow a custom dispatcher to be provided to routing. 2015-08-07 20:06:24 -07:00
Xavier Shay
f26ae7d10f Move controller_reference and controller_class_names to protected
scope so that they are available to subclasses.
2015-08-07 19:50:14 -07:00
Aaron Patterson
05934d24af deprecate the env method on controller instances
people should be accessing request information through the request
object, not via the env hash.  If they really really want at the env
hash, then they can get it off the request.
2015-08-07 16:27:32 -07:00
Aaron Patterson
869b007172 the request object manages env
remove the setter.  The request object manages the env hash, so any
mutations need to go through it
2015-08-07 16:20:38 -07:00
Aaron Patterson
1f80f3a373 remove vestigial code
Looks like this was left over from converting Rails to Rack.  I think
it's safe to remove now.
2015-08-07 16:17:22 -07:00
Aaron Patterson
81cfdf2489 stop using @_env in the controller instance
Actions are processed through `dispatch`, so they should have the
request set on them before any user land code can be executed.  Lets
stop setting _env on the controller, and give access to it through the
`env` method.
2015-08-07 16:00:57 -07:00
Aaron Patterson
2a3c47ff5d finish deprecating handling strings and symbols
since we only work with instances of classes, it greatly simplifies the
`Middleware` implementation.
2015-08-07 15:37:31 -07:00
Aaron Patterson
83b767cef9 Using strings or symbols for middleware class names is deprecated.
Convert things like this:

  middleware.use "Foo::Bar"

to this:

  middleware.use Foo::Bar
2015-08-07 15:37:31 -07:00