Skip to content

Loading…

more cowbell #2

Closed
webiest opened this Issue · 5 comments

5 participants

@webiest

No description provided.

@ghost

gold plated diapers

@mischa

+1

@samoli

+1

@qrush

-1

@rabble

+1

@tomstuart tomstuart pushed a commit to econsultancy/rails that referenced this issue
@briandoll briandoll Fixing spelling error in activerecord guide in the validation callbac…
…ks section, closing issue #2
3807db8
@bfolkens bfolkens added a commit to bfolkens/rails that referenced this issue
@bfolkens bfolkens Fixing bad tree #2 9de9142
@bfolkens bfolkens referenced this issue
Commit has since been removed from the repository and is no longer available.
@dyba dyba referenced this issue
Commit has since been removed from the repository and is no longer available.
@Mochaleaf Mochaleaf pushed a commit to Mochaleaf/rails that referenced this issue
@leepfrog leepfrog rails#759 -
There are two issues here:

#1) ActiveSupport::Date current method has a misleading conditional. Time.zone is always returned because config.time_zone is set by default on a project.

#2) ActiveSupport::Date does not override the Date.today method. This means that the core ruby library's .today method is called which may be based off of a different time zone than what's set in config.time_zone.

Submitting a pull request.
151723e
@Mochaleaf Mochaleaf pushed a commit to Mochaleaf/rails that referenced this issue
@leepfrog leepfrog Fixing bugs in ActiveSupport::Date. Fixes #759.
There are two issues here:

#1) ActiveSupport::Date current method has a misleading conditional. Time.zone is always returned because config.time_zone is set by default on a project.

#2) ActiveSupport::Date does not override the Date.today method. This means that the core ruby library's .today method is called which may be based off of a different time zone than what's set in config.time_zone.
2d54abd
@joergschray joergschray referenced this issue
Commit has since been removed from the repository and is no longer available.
@derekkraan derekkraan added a commit to Springest/rails that referenced this issue
@derekkraan derekkraan Attempt to fix #2 (no tests yet). f54c859
@joergschray joergschray referenced this issue
Commit has since been removed from the repository and is no longer available.
@joergschray joergschray referenced this issue
Commit has since been removed from the repository and is no longer available.
@joergschray joergschray referenced this issue
Commit has since been removed from the repository and is no longer available.
@joergschray joergschray added a commit to tandem-softworks/rails that referenced this issue
@joergschray joergschray Issue #1: :before_add callback is called when nested attributes assig…
…nment assigns to existing record if the association is not yet loaded

Issue #2: Nested Attributes assignment does not affect the record in the association target when callback triggers loading of the association

Complete rewrite of tests
1eced51
@Empact Empact referenced this issue
Commit has since been removed from the repository and is no longer available.
@Empact Empact referenced this issue
Commit has since been removed from the repository and is no longer available.
@Empact Empact referenced this issue
Commit has since been removed from the repository and is no longer available.
@Empact Empact referenced this issue
Commit has since been removed from the repository and is no longer available.
@Empact Empact referenced this issue
Commit has since been removed from the repository and is no longer available.
@Empact Empact added a commit to Empact/rails that referenced this issue
@joergschray joergschray Fix interactions between :before_add callbacks and nested attributes …
…assignment

Issue #1: :before_add callback is called when nested attributes assignment assigns to existing record if the association is not yet loaded
Issue #2: Nested Attributes assignment does not affect the record in the association target when callback triggers loading of the association
018697d
@ehtb ehtb referenced this issue
Commit has since been removed from the repository and is no longer available.
@rafaelfranca rafaelfranca pushed a commit that referenced this issue
@claudiob claudiob Remove duplicate stringify_keys in text_field_tag
All the methods that invoke `text_field_tag` (such as `hidden_field_tag`)
and all the methods that invoke `number_field_tag` (that is `range_field_tag`)
do not need to call `stringify_keys` on their `options` parameter since the
`text_field_tag` method [is already doing it internally](https://github.com/claudiob/rails/blob/4159134524f4c78d008eef9d9a17f73a3172dcc8/actionview/lib/action_view/helpers/form_tag_helper.rb#L182):

```ruby
def text_field_tag(name, value = nil, options = {})
  tag :input, { "type" => "text", "name" => name, "id" => sanitize_to_id(name), "value" => value }.update(options.stringify_keys)
end
```

and `number_field_tag` is [already doing it internally](https://github.com/claudiob/rails/blob/e3207bdbba55f3806441f22b175557579bc0b051/actionview/lib/action_view/helpers/form_tag_helper.rb#L780) as well:

```ruby
def number_field_tag(name, value = nil, options = {})
  options = options.stringify_keys
  ...
end

[Note #1: My code uses `merge` to respect the existing behavior of
duplicating the `options` hash before updating its keys, see #17096 (comment)]

[Note #2: My code uses symbols instead of strings (e.g.: `:hidden`) to look
forward to future version of Ruby/Raiks (GC symbols); the result of the method,
however, is the same, because the symbols are stringified inside `text_field_tag`]

[Note #3: I had previously created a similar PR #17096 but decided to
split it into multiple PRs given the feedback received in the comments]
a9050e7
@sachin004 sachin004 added a commit to sachin004/rails that referenced this issue
@claudiob claudiob Remove duplicate stringify_keys in text_field_tag
All the methods that invoke `text_field_tag` (such as `hidden_field_tag`)
and all the methods that invoke `number_field_tag` (that is `range_field_tag`)
do not need to call `stringify_keys` on their `options` parameter since the
`text_field_tag` method [is already doing it internally](https://github.com/claudiob/rails/blob/4159134524f4c78d008eef9d9a17f73a3172dcc8/actionview/lib/action_view/helpers/form_tag_helper.rb#L182):

```ruby
def text_field_tag(name, value = nil, options = {})
  tag :input, { "type" => "text", "name" => name, "id" => sanitize_to_id(name), "value" => value }.update(options.stringify_keys)
end
```

and `number_field_tag` is [already doing it internally](https://github.com/claudiob/rails/blob/e3207bdbba55f3806441f22b175557579bc0b051/actionview/lib/action_view/helpers/form_tag_helper.rb#L780) as well:

```ruby
def number_field_tag(name, value = nil, options = {})
  options = options.stringify_keys
  ...
end

[Note #1: My code uses `merge` to respect the existing behavior of
duplicating the `options` hash before updating its keys, see rails#17096 (comment)]

[Note #2: My code uses symbols instead of strings (e.g.: `:hidden`) to look
forward to future version of Ruby/Raiks (GC symbols); the result of the method,
however, is the same, because the symbols are stringified inside `text_field_tag`]

[Note #3: I had previously created a similar PR #17096 but decided to
split it into multiple PRs given the feedback received in the comments]
59d8c08
@divineforest divineforest added a commit that referenced this issue
@claudiob claudiob Remove duplicate stringify_keys in text_field_tag
All the methods that invoke `text_field_tag` (such as `hidden_field_tag`)
and all the methods that invoke `number_field_tag` (that is `range_field_tag`)
do not need to call `stringify_keys` on their `options` parameter since the
`text_field_tag` method [is already doing it internally](https://github.com/claudiob/rails/blob/4159134524f4c78d008eef9d9a17f73a3172dcc8/actionview/lib/action_view/helpers/form_tag_helper.rb#L182):

```ruby
def text_field_tag(name, value = nil, options = {})
  tag :input, { "type" => "text", "name" => name, "id" => sanitize_to_id(name), "value" => value }.update(options.stringify_keys)
end
```

and `number_field_tag` is [already doing it internally](https://github.com/claudiob/rails/blob/e3207bdbba55f3806441f22b175557579bc0b051/actionview/lib/action_view/helpers/form_tag_helper.rb#L780) as well:

```ruby
def number_field_tag(name, value = nil, options = {})
  options = options.stringify_keys
  ...
end

[Note #1: My code uses `merge` to respect the existing behavior of
duplicating the `options` hash before updating its keys, see #17096 (comment)]

[Note #2: My code uses symbols instead of strings (e.g.: `:hidden`) to look
forward to future version of Ruby/Raiks (GC symbols); the result of the method,
however, is the same, because the symbols are stringified inside `text_field_tag`]

[Note #3: I had previously created a similar PR #17096 but decided to
split it into multiple PRs given the feedback received in the comments]
24bce01
@tijmenb tijmenb added a commit to tijmenb/rails that referenced this issue
@tijmenb tijmenb Add text template for source code
When a request is made with AJAX and an error occurs, Rails will render
a text-template for the exception instead of the HTML error page
(#11960).

The `.text.erb` variant of the `_source` template is currently missing,
causing HTML to be rendered in the response. This commit adds the text
template.

Related to #14745.

Before:

```
~/testing-exceptions  ᐅ curl 'http://localhost:3000/' -H
'X-Requested-With: XMLHttpRequest'
RuntimeError in PostsController#index

    <div class="source " id="frame-source-0">
      <div class="info">
        Extracted source (around line <strong>#3</strong>):
      </div>
      <div class="data">
        <table cellpadding="0" cellspacing="0" class="lines">
          <tr>
```

After:

```
~/testing-exceptions  ᐅ curl 'http://localhost:3000/' -H
'X-Requested-With: XMLHttpRequest'
RuntimeError in PostsController#index

Extracted source (around line #3):

#1 class PostsController < ApplicationController
#2   def index
*3     raise
#4   end
#5 end
```
054edd9
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.