Commit Graph

2282 Commits

Author SHA1 Message Date
Aaron Patterson
5491710934 remove another value from IGNORE_OPTIONS 2014-06-03 11:33:50 -07:00
Aaron Patterson
a04767d77c shorten up IGNORE_OPTIONS
since we are now passing the format value around, we can remove it from
the options hash, which means we don't need to consult as many values
from IGNORE_OPTIONS
2014-06-03 11:33:50 -07:00
Aaron Patterson
f28788b257 only look up the format option from the hash once 2014-06-03 11:33:50 -07:00
Aaron Patterson
74b73f132a Mapping never actually uses @set, so rm 2014-05-29 16:13:29 -07:00
Aaron Patterson
be137b0ac3 no reason to make a Mapper object if the path is blank 2014-05-29 16:08:56 -07:00
Aaron Patterson
da2cf937aa no more is_a checks on instantiation 2014-05-29 15:45:42 -07:00
Aaron Patterson
bb207ea7b6 Path::Pattern is instantiated internally, so make the contructor require a strexp object 2014-05-29 15:44:54 -07:00
Aaron Patterson
5682596db7 Strexp#names is only used in a test, so rm 2014-05-29 15:31:45 -07:00
Aaron Patterson
333a4d09ab pass the parsed path from mapper to the Strexp 2014-05-29 15:27:46 -07:00
Aaron Patterson
15ffbedf3b add an alternate constructor to Strexp that takes a string 2014-05-29 15:23:30 -07:00
Aaron Patterson
eabe504cdf ask the strexp for the ast 2014-05-29 15:16:40 -07:00
Aaron Patterson
7da98d0a59 remove dead code 2014-05-29 15:08:12 -07:00
Aaron Patterson
b3719d34d2 disconnect path from the instance 2014-05-29 15:05:22 -07:00
Aaron Patterson
ffbe1b18c2 reuse the ast we already made 2014-05-29 15:01:08 -07:00
Aaron Patterson
3a102a58f4 use a parser to extract the group parts from the path 2014-05-29 14:57:48 -07:00
Aaron Patterson
b5ea25bc44 pass the parsed parameters through the methods so we don't reparse or
require caching code
2014-05-29 14:44:56 -07:00
Aaron Patterson
295e912211 Merge branch 'master' into mapper
* master:
  Update url to rake docs [ci skip]
  Name#model_name doesn't return a String object
  Result sets never override a model's column type
  [ci skip] Make last note show up in postgresql guide.
  Add missing `:param` option from the docs for Mapper#match [ci skip] Option discovered by @zackperdue in #14741, implemented in #5581.
  Add @senny's changed from #14741, including code font for `resources` options, and wrapped to 80 chars. [ci skip]
  Use github url for homepage of log4r [ci skip]
  Remove TODO.
  Ensure we always use instances of the adapter specific column class
  Fix indentation from 1b4b26f [ci skip]
  [ci skip] Improve form_helpers.md guide.
  Clear inflections after test.
  Remove unnecessary include for integration tests.
  Added documentation for the :param option for resourceful routing
2014-05-29 10:56:33 -07:00
Aaron Patterson
8ed1a562c6 "controllers" should be a valid path name 2014-05-29 10:55:59 -07:00
Matthew Draper
29f8eae3fa Merge pull request #15061 from tgxworld/remove_unnecessary_include
Remove unnecessary include for integration tests.
2014-05-29 21:33:12 +09:30
Zachary Scott
3b606a3259 Add missing :param option from the docs for Mapper#match [ci skip]
Option discovered by @zackperdue in #14741, implemented in #5581.
2014-05-29 00:24:06 -07:00
Aaron Patterson
7e61a327ce controllers with slash names are also not supported, so we can reuse the message 2014-05-28 18:07:25 -07:00
Aaron Patterson
d311922c82 only validate controllers 2014-05-28 18:03:26 -07:00
Aaron Patterson
75bfe64783 golf down a bit 2014-05-28 17:42:34 -07:00
Aaron Patterson
3d0dc81a07 only error handling between controller and action is the same 2014-05-28 17:28:59 -07:00
Aaron Patterson
89bf31ee56 move nil check to a method that yields to a block if the value is not nil 2014-05-28 16:59:32 -07:00
Aaron Patterson
78deb7f1b8 translate action / controller to the desired object 2014-05-28 16:49:47 -07:00
Aaron Patterson
309ff10d7d only one nil check on the action variable 2014-05-28 16:34:36 -07:00
Aaron Patterson
a729f40507 change to case / when on types 2014-05-28 16:31:40 -07:00
Aaron Patterson
b27a3aff35 only do one nil check against the controller 2014-05-28 16:28:38 -07:00
Aaron Patterson
8d309832df extract controller and action parsing to a method 2014-05-28 16:23:17 -07:00
Aaron Patterson
bc916a7e58 we don't need the call to presence. that is my present, to you! 2014-05-28 16:16:14 -07:00
Aaron Patterson
3c03e7e2ab swtich to returning early if to responds to call 2014-05-28 16:14:22 -07:00
Aaron Patterson
ac9a3a9d64 return early if we have a valid controller name 2014-05-28 16:00:40 -07:00
Aaron Patterson
996e9f568c trade 2 is_a? checks for a nil check 2014-05-28 15:56:12 -07:00
Aaron Patterson
60ae50507d invert logic to remove nil? and exclude? checks (use ruby rather than AS when possible 2014-05-28 15:54:43 -07:00
Aaron Patterson
353df48a34 fewer blank? calls 2014-05-28 15:50:22 -07:00
Aaron Patterson
c99d28f1f2 reduce action.blank? calls 2014-05-28 15:46:00 -07:00
Aaron Patterson
f0eff10c09 reduce blank? checks 2014-05-28 15:38:11 -07:00
Aaron Patterson
ddda5e70f7 extract controller checks to methods 2014-05-28 15:33:32 -07:00
Aaron Patterson
1ad50aa379 set defaults at the top so we can avoid the ||= test 2014-05-28 15:15:44 -07:00
Aaron Patterson
cd037783b0 rm dead code 2014-05-27 14:52:59 -07:00
Aaron Patterson
2ffa126f79 PARAMETERS_KEY is only used in the request, so move the constant there 2014-05-27 14:46:04 -07:00
Aaron Patterson
cfdab77d1f Merge branch 'constraints'
* constraints:
  rm reset_parameters because we automatically do it from 9ca4839a
  move path_parameter encoding check to the request object
  dispatcher doesn't need `call` anymore
  call `serve` with the request on dispatchers
  constraints class does not need the request class anymore
  give all endpoints a superclass
  skip the build business if the stack is empty
  stop hardcoding path_parameters and get it from the request
  we do not need to cache rack_app
  a redirect is not a dispatcher by definition, so eliminate test
  push is_a check up to where the Constraints object is allocated
  pass the request object to the application
  pass a request to `matches?` so we can avoid creating excess requests
  nothing is passed to `rack_app` anymore, so rm the params
  one fewer is_a check
  Constraints#app should never return another Constraints object, so switch to if statement
  eliminate dispatcher is_a checks
  push is_a?(Dispatcher) check in to one place
  Always construct route objects with Constraint objects

Conflicts:
	actionpack/lib/action_controller/metal.rb
2014-05-27 14:40:55 -07:00
Aaron Patterson
406b1b6464 rm reset_parameters because we automatically do it from 9ca4839a 2014-05-27 14:24:30 -07:00
Aaron Patterson
4797c4caca move path_parameter encoding check to the request object 2014-05-27 14:01:30 -07:00
Aaron Patterson
97a52283f8 dispatcher doesn't need call anymore 2014-05-27 13:54:59 -07:00
Aaron Patterson
9ad01d0ade call serve with the request on dispatchers 2014-05-27 13:51:58 -07:00
Aaron Patterson
7fe14432d8 constraints class does not need the request class anymore 2014-05-27 13:44:58 -07:00
Aaron Patterson
402c2af550 give all endpoints a superclass 2014-05-27 12:10:24 -07:00
Santiago Pastorino
6f9aff75a5 Merge pull request #15321 from tgxworld/only_find_routes_as_heads_for_head_request
Call get_routes_as_head only on HEAD requests.
2014-05-27 14:46:49 -03:00