| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|\
| |
| |
| | |
Use public_send in value_for_collection
|
|/
|
|
|
|
|
|
| |
Test that using private methods in `options_from_collection_for_select`
is deprecated.
Make the unused `secret` paramether in the `Post` Struct private to use
it in the test.
|
| |
|
| |
|
|\
| |
| |
| |
| | |
Aquaj/feature/allow-callables-in-select-group-methods
Allow the use of callable objects as group methods for grouped selects.
|
| |
| |
| |
| |
| |
| | |
Replaced the uses of `group.send(...)` in `option_groups_from_collection_for_select`
by calls to `value_for_collection(group, ...)`, allowing the use of
procs, lambdas and other callable objects as parameters.
|
|/
|
|
| |
Follow up of #31390.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
### Summary
The [`:field_error_proc`](https://github.com/rails/rails/blob/master/actionview/lib/action_view/base.rb#L145) is responsible for decorating input tags that refer to attributes with errors. This default build-in rails feature wrap invalid form elements with additional markup: `<div class="field_with_errors">[…]</div>`.
* Fix for `field_error_proc` wraps form select `optgroup`
* Fix for `field_error_proc` wraps form select divider `option`
* Add tests for uncovered elements with errors
[Fixes #31088]
#### Test coverage
* `test_select_grouped_options_with_errors`
* `test_time_zone_select_with_priority_zones_and_errors`
#### Extend test coverage
* `test_collection_select_with_errors`
* `test_label_with_errors`
* `test_check_box_with_errors`
* `test_check_boxes_with_errors`
* `test_radio_button_with_errors`
* `test_radio_buttons_with_errors`
* `test_collection_check_boxes_with_errors`
* `test_collection_radio_buttons_with_errors`
|
|
|
|
| |
And enable `context_dependent` of Style/BracesAroundHashParameters cop.
|
| |
|
|
|
|
|
|
|
| |
We have some indentation cops. But now there is a little inconsistent
params indentations. Enable `Layout/FirstParameterIndentation` cop to
prevent newly inconsistent indentation added and auto-correct to
existing violations.
|
|
|
|
|
| |
This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing
changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
|
| |
|
|
|
|
|
|
| |
Allows a custom object implementing Enumerable to be used as the choices
parameter for a select tag, which previously wasn't possible due to the
call to `empty?` on the choices (which isn't implemented on Enumerable).
|
|
|
|
| |
(I personally prefer writing one string in one line no matter how long it is, though)
|
| |
|
|
|
|
|
|
|
|
| |
Style/SpaceBeforeBlockBraces
Style/SpaceInsideBlockBraces
Style/SpaceInsideHashLiteralBraces
Fix all violations in the repository.
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
| |
The current code base is not uniform. After some discussion,
we have chosen to go with double quotes by default.
|
|
|
|
| |
- Renamed test to be more descriptive
|
|
|
|
|
|
|
|
| |
Ruby 2.4 unifies Fixnum and Bignum into Integer: https://bugs.ruby-lang.org/issues/12005
* Forward compat with new unified Integer class in Ruby 2.4+.
* Backward compat with separate Fixnum/Bignum in Ruby 2.2 & 2.3.
* Drops needless Fixnum distinction in docs, preferring Integer.
|
|
|
|
|
|
| |
of html_safe in favour of raw() in AV helpers.
Also changed usage of html_safe to make use of raw() instead so that the intended behaviour is verified with raw()
|
|
|
|
|
|
|
| |
Erroneously removed in 58910dc7.
The stubbing was a regression test to ensure `time_zone_select` wasn't implemented with
`grep`. Rename the test and add a comment to make the intent clearer.
|
|
|
|
| |
We never touch the index, so don't bother.
|
|
|
|
|
|
|
|
|
| |
When calling `test_time_zone_select_with_priority_zones_as_regexp` it would
define `=~` on the fake zones, but it would never be cleaned up because of
the zone cache.
Nuke it so `test_time_zone_select_with_priority_zones_as_regexp_using_grep_finds_no_zones`
accidentally find any zones because of `=~` being implemented.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
`Tags::Base#select_content_tag`.
Previously, passing a falsey value to `include_blank` would be ignored if the
field was required, and a blank line would still be inserted. The following will
now raise instead of quietly failing:
`select("post", "category", %w(a required field), { include_blank: false }, required: 'required')`
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
Example:
= select(report, "campaign_ids") do
- available_campaigns.each do |c|
%option{:data => {:tags => c.tags.to_json}, :value => c.id}= c.name
|
|
|
|
|
|
|
| |
AS does the following inside Time.find_zone! ...
`ActiveSupport::TimeZone[time_zone] || TZInfo::Timezone.get(time_zone)`
and given that the test is stubbing AS::TZ[] we don't need the removed
code.
|
| |
|
|
|
|
| |
because it was deprecated.
|
|
|