- 28 9月, 2018 1 次提交
-
-
由 Simon Courtois 提交于
This PR fixes an issue when the following situation occurs. If you define a class like this class MyConstraint def call(*args) # for some reason this is defined end def matches?(*args) # checking the args end end and try to use it as a constraint get "/", to: "home#show", constraints: MyConstraint.new if its `matches?` method returns `false` there will be an error for the mapper will ask for the constraint arity, thinking it is a proc, lambda or method. This PR checks for the presence of the `arity` method on the constraint calling it only if present, preventing the error while keeping the basic behavior.
-
- 26 9月, 2018 1 次提交
-
-
由 Aaron Patterson 提交于
This commit eagerly builds the route helper module after the routes have been drawn and finalized. This allows us to cache the helper module but not have to worry about people accessing the module while route definition is "in-flight", and automatically deals with cache invalidation as the module is regenerated anytime someone redraws the routes. The restriction this commit introduces is that the url helper module can only be accessed *after* the routes are done being drawn. Refs #24554 and #32892
-
- 23 9月, 2018 1 次提交
-
-
由 yuuji.yaginuma 提交于
In Ruby 2.3 or later, `String#+@` is available and `+@` is faster than `dup`. ```ruby # frozen_string_literal: true require "bundler/inline" gemfile(true) do source "https://rubygems.org" gem "benchmark-ips" end Benchmark.ips do |x| x.report('+@') { +"" } x.report('dup') { "".dup } x.compare! end ``` ``` $ ruby -v benchmark.rb ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux] Warming up -------------------------------------- +@ 282.289k i/100ms dup 187.638k i/100ms Calculating ------------------------------------- +@ 6.775M (± 3.6%) i/s - 33.875M in 5.006253s dup 3.320M (± 2.2%) i/s - 16.700M in 5.032125s Comparison: +@: 6775299.3 i/s dup: 3320400.7 i/s - 2.04x slower ```
-
- 25 8月, 2018 1 次提交
-
-
由 Kevin Deisz 提交于
-
- 29 7月, 2018 1 次提交
-
-
由 Bart de Water 提交于
In cases where the MatchData object is not used, this provides a speed-up: https://github.com/JuanitoFatas/fast-ruby/#stringmatch-vs-stringmatch-vs-stringstart_withstringend_with-code-start-code-end
-
- 24 7月, 2018 1 次提交
-
-
由 Paul McMahon 提交于
http links will be redirected to the https version, but still better to just directly link to the https version.
-
- 21 3月, 2018 1 次提交
-
-
由 Andrew White 提交于
The urls helpers module returned by Rails.application.routes.url_helpers isn't cached so to prevent the cost of building the module cache it locally.
-
- 17 2月, 2018 1 次提交
-
-
由 Rafael Mendonça França 提交于
Some places we can't remove because Ruby still don't have a method equivalent to strip_heredoc to be called in an already existent string.
-
- 20 1月, 2018 1 次提交
-
-
由 James Lovejoy 提交于
[ci skip]
-
- 23 11月, 2017 1 次提交
-
-
由 T.J. Schuck 提交于
Particularly, the bulleted list was getting formatted as a code block because of the extra level of indentation. Pulling it back to the left makes it render properly as a list instead. [ci skip]
-
- 04 11月, 2017 1 次提交
-
-
由 bogdanvlviv 提交于
-
- 21 10月, 2017 1 次提交
-
-
由 Akira Matsuda 提交于
This basically reverts e9fca766, d08da958, d1fe1dcf, and 68eaf7b4
-
- 19 8月, 2017 1 次提交
-
-
由 Zoran Pesic 提交于
-
- 18 8月, 2017 1 次提交
-
-
由 yui-knk 提交于
We always plural form for `resources` method.
-
- 24 7月, 2017 1 次提交
-
-
由 David Rodríguez 提交于
-
- 11 7月, 2017 1 次提交
-
-
由 Koichi ITO 提交于
-
- 07 7月, 2017 1 次提交
-
-
由 Kir Shatrov 提交于
-
- 06 7月, 2017 1 次提交
-
-
由 David Rodríguez 提交于
-
- 02 7月, 2017 1 次提交
-
-
由 Matthew Draper 提交于
This reverts commit 3420a145, reversing changes made to afb66a5a.
-
- 01 7月, 2017 2 次提交
-
-
由 Akira Matsuda 提交于
-
由 Kir Shatrov 提交于
-
- 04 6月, 2017 1 次提交
-
-
- 03 6月, 2017 1 次提交
-
-
由 yuuji.yaginuma 提交于
-
- 18 4月, 2017 1 次提交
-
-
由 Andrew White 提交于
The current check for whether to add an optional format to the path is very lax and will match things like `:format_id` where there are nested resources, e.g: resources :formats do resources :items end Fix this by using a more restrictive regex pattern that looks for the patterns `(.:format)`, `.:format` or `/` at the end of the path. Note that we need to allow for multiple closing parenthesis since the route may be of this form: get "/books(/:action(.:format))", controller: "books" This probably isn't what's intended since it means that the default index action route doesn't support a format but we have a test for it so we need to allow it. Fixes #28517.
-
- 14 3月, 2017 1 次提交
-
-
由 Hrvoje Šimić 提交于
-
- 06 3月, 2017 1 次提交
-
-
由 yuuji.yaginuma 提交于
Since `ActionController:Parameters` does not inherit `Hash`, need to explicitly convert it to `Hash`. Also, `Parameters#to_h` returns `Hash` whose key is `String`. Therefore, if merge as it is, the value will not be overwritten as expected.
-
- 26 2月, 2017 1 次提交
-
-
由 Jerry Tao 提交于
-
- 23 2月, 2017 2 次提交
-
-
由 Andrew White 提交于
Also correct use of `direct class:` to `resolve` in example.
-
由 Andrew White 提交于
Since a `direct` url helper block is evaluated using `instance_exec` then methods that are available in the instance context can be accessed, e.g. the params object in a controller action or view. This wasn't clear from the example so expand on that point and add a test case for this situation.
-
- 22 2月, 2017 1 次提交
-
-
由 Kasper Timm Hansen 提交于
Use double quoted strings, come down hard on some typos.
-
- 21 2月, 2017 7 次提交
-
-
由 Andrew White 提交于
Use a separate method called `resolve` for the custom polymorphic mapping to clarify the API.
-
由 Andrew White 提交于
-
由 Andrew White 提交于
Allow the use of `direct` to specify custom mappings for polymorphic_url, e.g: resource :basket direct(class: "Basket") { [:basket] } This will then generate the following: >> link_to "Basket", @basket => <a href="/basket">Basket</a> More importantly it will generate the correct url when used with `form_for`. Fixes #1769.
-
由 Andrew White 提交于
-
由 Andrew White 提交于
-
由 Andrew White 提交于
-
由 Andrew White 提交于
Allow the definition of custom url helpers that will be available automatically wherever standard url helpers are available. The current solution is to create helper methods in ApplicationHelper or some other helper module and this isn't a great solution since the url helper module can be called directly or included in another class which doesn't include the normal helper modules. Reference #22512.
-
- 16 1月, 2017 1 次提交
-
-
由 David Heinemeier Hansson 提交于
This was preventing the test suite from being run in isolation
-
- 04 1月, 2017 1 次提交
-
-
由 Rafael Mendonça França 提交于
-
- 24 12月, 2016 1 次提交
-
-
由 Akira Matsuda 提交于
-