- 27 12月, 2018 1 次提交
-
-
由 Genadi Samokovarov 提交于
The `#csrf_meta_tags` and `#token_tag` Action View helper methods are expecting the class in which are included to explicitly define the method `#protect_against_forgery?` or else they will fail with `NoMethodError`. This is a problem if you want to use Action View outside of Rails applications. For example, in #34788 I used the `#button_to` helper inside of the error pages templates that have a custom `ActionView::Base` subclass, which did not defined `#protect_against_forgery?` and trying to call the button failed. I had to dig inside of Action View to find-out what's was going on. I think we should either set a default method implementation in the helpers or check for the method definition, but don't explicitly require the presence of `#protect_against_forgery?` in every `ActionViews::Base` subclass as the errors are hard to figure out.
-
- 26 12月, 2018 2 次提交
-
-
由 Yuji Yaginuma 提交于
Generate doc of methods provided by form builders [ci skip]
-
由 yuuji.yaginuma 提交于
Because method arguments are different in the methods provided by form helpers and form builders, I think these are necessary to prevent confusion. Fixes #34787
-
- 25 12月, 2018 2 次提交
-
-
由 yuuji.yaginuma 提交于
Host authentication introduced by #33145 allows only "0.0.0.0/0", "::/0" and "localhost" in the development environment. https://github.com/rails/rails/blob/4298df00ae6219b9b5b7c40f281d4fa4d66f4383/railties/lib/rails/application/configuration.rb#L33 But `rack-test` use `example.org` for default host. https://github.com/rack-test/rack-test/blob/6c07bf53adf4a4082e206561f5b9b43142fdc821/lib/rack/test.rb#L13 Therefore, if `hosts` is not specified, host authentication rejects the request. In Travis CI, this problem does not occur because `test` is specified by default in `RAILS_ENV` and `RACK_ENV`. https://docs.travis-ci.com/user/environment-variables/#default-environment-variables If user actually use it, env may not always be specified. Explicitly specify hosts in the file so that it works in any environment.
-
由 Kasper Timm Hansen 提交于
Make Rails Facebook-free
-
- 24 12月, 2018 3 次提交
-
-
由 Sasha Koss 提交于
If Basecamp is a Facebook-free business, then Rails should be Facebook-free framework.
-
-
由 Kasper Timm Hansen 提交于
No need to handle if FrozenError is available
-
- 23 12月, 2018 2 次提交
-
-
由 Yasuo Honda 提交于
Rails 6 requires Ruby 2.5, which introduces `FrozenError` https://docs.ruby-lang.org/en/2.5.0/NEWS.html Related to #31520
-
由 yuuji.yaginuma 提交于
These were unused since 11af089c and e35b98e6.
-
- 22 12月, 2018 4 次提交
-
-
由 Eileen M. Uchitelle 提交于
Fix app boot for Ruby 2.4
-
由 Eileen Uchitelle 提交于
I have a test app that was on Ruby 2.4. When I pulled Rails master the app no longer would boot because of this change and I saw the following error: ``` SyntaxError: /Users/eileencodes/open_source/real_rails/railties/lib/rails/all.rb:18: syntax error, unexpected keyword_rescue, expecting keyword_end rescue LoadError ^ ``` Ruby 2.4 doesn't support removing redundant begins so the real issue is that this app is on Ruby 2.4 and not on Ruby 2.5. But it's super confusing for a user to understand the reason the app is failing to boot is because we need Ruby 2.5. I added this redundant begin back because we need to give a clearer error message.
-
由 Eileen M. Uchitelle 提交于
Raise helpful error when role doesn't exist
-
由 Eileen Uchitelle 提交于
If you try to call `connected_to` with a role that doesn't have an established connection you used to get an error that said: ``` >> ActiveRecord::Base.connected_to(role: :i_dont_exist) { Home.first } ActiveRecord::ConnectionNotEstablished Exception: No connection pool with 'primary' found. ``` This is confusing because the connection could be established but we spelled the role wrong. I've changed this to raise if the `role` used in `connected_to` doesn't have an associated handler. Users who encounter this should either check that the role is spelled correctly (writin -> writing), establish a connection to that role in the model with connects_to, or use the `database` keyword for the `role`. I think this will provide a less confusing error message for those starting out with multiple databases.
-
- 21 12月, 2018 17 次提交
-
-
由 Ryuta Kamizono 提交于
Fix Ruby 2.6 `warning: mismatched indentations at 'rescue' with 'def' at 15`.
-
-
由 yuuji.yaginuma 提交于
-
由 Yuji Yaginuma 提交于
Use BigDecimal provided methods to convert String to BigDecimal
-
由 Ryuta Kamizono 提交于
MySQL: `ROW_FORMAT=DYNAMIC` create table option by default
-
由 Ryuta Kamizono 提交于
Enable `Style/RedundantBegin` cop to avoid newly adding redundant begin block
-
由 Ryuta Kamizono 提交于
Module.delegate rdoc update to clarify :to parameter [ci skip]
-
由 Yuji Yaginuma 提交于
Do no watch parent directory of `dirs`
-
由 Eddie Lebow 提交于
-
由 yuuji.yaginuma 提交于
`String#to_d` does not raise an exception if an invalid value is specified. So can remove exception handling. ``` $ bundle exec ruby -v -rbigdecimal -rbigdecimal/util -e 'p "123,003".to_d' ruby 2.6.0dev (2018-12-21 trunk 66474) [x86_64-linux] 0.123e3 ```
-
由 yuuji.yaginuma 提交于
This is a regression test for #34751.
-
由 Vinicius Stock 提交于
* Fix integer regex deprecation warnings for Ruby 2.6.0 * Define =~ in FakeZone to avoid warnings from Ruby 2.6.0
-
由 Kasper Timm Hansen 提交于
Follow up #34754
-
由 Ryuta Kamizono 提交于
Currently we sometimes find a redundant begin block in code review (e.g. https://github.com/rails/rails/pull/33604#discussion_r209784205). I'd like to enable `Style/RedundantBegin` cop to avoid that, since rescue/else/ensure are allowed inside do/end blocks in Ruby 2.5 (https://bugs.ruby-lang.org/issues/12906), so we'd probably meets with that situation than before.
-
-
由 bogdanvlviv 提交于
- Fix a few deprecation warnings - Remove testing of `Hash#slice` - Imporve test of `Hash#slice!` - Remove mention about `Hash#slice` from the guide
-
-
- 20 12月, 2018 9 次提交
-
-
由 Ryuta Kamizono 提交于
Follow up #34761.
-
由 Ryuta Kamizono 提交于
Use native `Array#append`, `Array#prepend`, `Hash#transform_keys`, and `Hash#transform_keys!`
-
由 Ryuta Kamizono 提交于
Since Rails 6 requires Ruby 2.5. https://github.com/ruby/ruby/blob/ruby_2_5/NEWS Follow up #34754.
-
由 Ryuta Kamizono 提交于
Unify _read_attribute definition to use &block
-
由 pavel 提交于
-
由 Takashi Kokubun 提交于
Thanks to ko1, passing block parameter to another method is significantly optimized in Ruby 2.5. https://bugs.ruby-lang.org/issues/14045 Thus we no longer need to keep this ugly hack.
-
由 Kasper Timm Hansen 提交于
Require Ruby 2.5 for Rails 6.
-
由 Kasper Timm Hansen 提交于
Generally followed the pattern for https://github.com/rails/rails/pull/32034 * Removes needless CI configs for 2.4 * Targets 2.5 in rubocop * Updates existing CHANGELOG entries for fewer merge conflicts * Removes Hash#slice extension as that's inlined on Ruby 2.5. * Removes the need for send on define_method in MethodCallAssertions.
-
由 Kasper Timm Hansen 提交于
-