profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/aki2o/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.

aki2o/emacs-bts 32

A unified user Interface for various bug tracking systems in Emacs

aki2o/auto-complete-nxml 21

Provide a interface for auto-complete.el on nXML-mode

aki2o/emacs-bts-github 9

A plugin of bts for GitHub in Emacs

aki2o/auto-complete-pcmp 8

Provide auto-complete sources using pcomplete results

aki2o/bbdb- 8

More easily search/choice than BBDB

aki2o/direx-grep 8

Provide incremental search in direx.el buffer

aki2o/e2wm-term 8

Perspective of e2wm.el for work in terminal

aki2o/e2wm-direx 6

Plugin of e2wm.el for direx.el

aki2o/emacs-docker-robe 6

A plugin lets robe.el work under docker container.

aki2o/emacs-genrnc 6

Generate RELAX NG Compact Schema from RELAX NG Schema, XML Schema and DTD on Emacs

issue openedrails/rails

Setting belongs_to to nil with has_one results in a bad cached state

Steps to reproduce

# frozen_string_literal: true

require "bundler/inline"

gemfile(true) do
  source "https://rubygems.org"

  git_source(:github) { |repo| "https://github.com/#{repo}.git" }

  # Activate the gem you are reporting the issue against.
  gem "activerecord", "6.1.0"
  gem "sqlite3"
end

require "active_record"
require "minitest/autorun"
require "logger"

# This connection will do for database-independent bug reports.
ActiveRecord::Base.establish_connection(adapter: "sqlite3", database: ":memory:")
ActiveRecord::Base.logger = Logger.new(STDOUT)

ActiveRecord::Schema.define do
  create_table :posts, force: true do |t|
    t.timestamps
  end

  create_table :comments, force: true do |t|
    t.integer :post_id
  end
end

class Post < ActiveRecord::Base
  has_one :comment
end

class Comment < ActiveRecord::Base
  belongs_to :post, optional: true
end

class BugTest < Minitest::Test
  def test_association_stuff
    post = Post.create!
    comment = post.create_comment!

    assert_equal comment, post.comment
    assert_equal post, comment.post

    comment.update!(post: nil)

    assert_equal nil, comment.post

    # Seems like ideally this would work and if this was fixed the later more serious issue also would be
    # assert_equal nil, post.comment

    post.update!(updated_at: Time.now)

    # Making an unrelated update to post adds back the cached relationship causing this to fail
    assert_equal nil, comment.post
  end
end

Expected behavior

Ideally setting the relationship to nil on the belongs_to side would update the cached has_one side. In the worst case though the actual failing test above seems like a very bad outcome, where the relationship gets updated unexpectedly with state data.

Actual behavior

Removing the relationship on the belongs_to side leaves the cached has_one model in a bad state.

System configuration

Rails version: 6.1

Ruby version: 2.6

created time in 2 minutes

Pull request review commentrails/rails

Skip logging backtrace when exception is in `rescue_responses`

 module ActionDispatch   # This middleware is responsible for logging exceptions and   # showing a debugging page in case the request is local.   class DebugExceptions+    cattr_accessor :log_rescued_responses, default: true

Done.

flavorjones

comment created time in 6 minutes

push eventrails/rails

Santiago Bartesaghi

commit sha 507e729c2d2e7a17fc4034fa003ff534336e322e

Adjust guides to explain the need to disable the ActiveStorage default routes when implementing authenticated routes [ci skip]

view details

Zachary Scott

commit sha 1a01b7cb50c1b88522dd3c6adf8a2f4ba6ed2cfb

Merge pull request #42593 from santib/adjust-activestorage-security-docs Adjust guides to explain the need to disable the ActiveStorage default routes when implementing authenticated routes [ci skip]

view details

push time in 10 minutes

PR merged rails/rails

Adjust guides to explain the need to disable the ActiveStorage default routes when implementing authenticated routes [ci skip] docs

Summary

Follow up of https://github.com/rails/rails/pull/42551

If you don't stop drawing ActiveStorage routes, the files will still be accessible through publicly accessible URLs even when implementing the now suggested approach.

Other option would be overriding the ActiveStorage controllers or routes, but seems like that was not recommended by George.

cc @p8 @zzak

+8 -0

2 comments

1 changed file

santib

pr closed time in 10 minutes

issue commentrails/rails

assets precompile is connecting to db

In case anyone comes across this from google like I did, I spent a while trying to figure this out in my app. The stacktrace just showed that it was being triggered in environment.rb as the app initialized so it was hard to track down.

The issue ended up being that we're using the schema cache and somewhere in rails initializers if a schema_cache.yml file is present that triggers a check of the current migration from the DB.

I think this should potentially be treated as a rails bug -- the above comment claimed that Rails itself won't connect to the db during precompile, but it seems that's not always the case.

This is definitely the case. Run into this issue as soon as I start using schema_cache. Anybody aware of a workaround?

u007

comment created time in 13 minutes

pull request commentrails/rails

Improve disallow_raw_sql error msg and fix typo

Possibly unrelated quesiton: but do the other sanitize_sql_for_* methods not require Arel.sql objects?

Other sanitize_sql_for_* methods is not require Arel.sql objects, because they are not verified by disallow_raw_sql!

OuYangJinTing

comment created time in an hour

pull request commentrails/rails

Don't attach UJS form submission handlers to Turbo forms

@dhh was it expected that this would no longer apply data-confirm behavior in a situation like this?

<%= button_to 'Delete', method: :delete, data: { confirm: 'Are you sure?' }, form: { data: { turbo: true } } %>

This results in the following HTML:

<form data-turbo="true" class="button_to" method="post" action="...">
  <input type="hidden" name="_method" value="delete" />
  <input data-confirm="Are you sure?" type="submit" value="Delete" />
  <input type="hidden" name="authenticity_token" value="..." />
</form>

I believe it's because formInputClickSelector is used here.

dhh

comment created time in 2 hours

pull request commentrails/rails

Prevent polluting ENV with postgres vars

@sj26 yes, I think updating the mocks will be enough to get the test suite green.

sj26

comment created time in 3 hours

PR opened rails/rails

Deprecate replace_on_assign_to_many

Summary

Deprecate replace_on_assign_to_many

I only show the deprecation message when it's set to false since the behavior once the config is removed will be like when it's currently set to true. I tried adding a test in railties/test/application/configuration_test.rb

    test "config.active_storage.replace_on_assign_to_many being false is deprecated" do
      app_file "config/environments/development.rb", <<-RUBY
        Rails.application.configure do
          config.active_storage.replace_on_assign_to_many = false
        end
      RUBY

      assert_deprecated(/replace_on_assign_to_many/) do
        app "development"
      end
    end

but it didn't work. Not sure what's wrong with the test 😬 I tried it with a test app and I could see the deprecation message in the logs, although not sure why the deprecation message wasn't displayed in STDOUT

+14 -2

0 comment

2 changed files

pr created time in 3 hours

PR opened rails/rails

feat: Add a check for dash / hls video and audio

Summary

Adds booleans for dash / HLS videos as well as adding the checks to the #video? and #audio? methods.

Other Information

I've recently been using HLS for video / audio files and noticed that ActiveStorage blobs dont account for HLS / Dash videos as video or audio.

HLS and Dash can be used with <video> or <audio> tags by using various polyfills on unsupported browsers in the forms including the following 2 packages:

https://github.com/video-dev/hls.js/

https://github.com/Dash-Industry-Forum/dash.js/wiki

This is a preliminary PR and I'd love to hear other's thoughts on if this belongs here or not. I'd be happy to add tests if we think this is worthwhile.

+15 -5

0 comment

1 changed file

pr created time in 3 hours

pull request commentrails/rails

Prevent polluting ENV with postgres vars

Oh maybe I can update the mocks and that will be enough.

sj26

comment created time in 3 hours

pull request commentrails/rails

Prevent polluting ENV with postgres vars

Thanks @guilleiguaran, do you have any advice on the best way to test?

sj26

comment created time in 3 hours

pull request commentrails/rails

Always draw `disk_service` routes

I saw this open PR and I wanted to ask if you suggest us updating the docs here to make it explicit that the local disk service url routes will be generated even if draw_routes = false?

stefannibrasil

comment created time in 3 hours

pull request commentrails/rails

Always draw `disk_service` routes

@lfalcao @pixeltrix this PR is finally ready for review. Thank you in advance for the guidance :100:

stefannibrasil

comment created time in 3 hours

pull request commentrails/rails

Always draw `disk_service` routes

hi @zzak thank you for your support. We had a few errors after merging with main, they should be fixed now.

stefannibrasil

comment created time in 4 hours

PR opened rails/rails

Reviewers
Split out TestRun from ci/qunit-selenium-runner to separate file

This makes it easy to separate code that is not ours and include the license at the top and document it's origin on the class.

Follow up to #42513 /cc @ghiculescu

+71 -73

0 comment

2 changed files

pr created time in 4 hours

pull request commentrails/rails

Add clear message when rails new finishes

I think option 1 is preferred, you could always open a new PR for option 2. 🙏

supersam654

comment created time in 4 hours

pull request commentrails/rails

`Time#change` should pass the `zone` property through if it's set

@ghiculescu Can you add a changelog too plz? :bow:

ghiculescu

comment created time in 4 hours

pull request commentrails/rails

Improve disallow_raw_sql error msg and fix typo

Possibly unrelated quesiton: but do the other sanitize_sql_for_* methods not require Arel.sql objects?

OuYangJinTing

comment created time in 4 hours

pull request commentrails/rails

Improve disallow_raw_sql error msg and fix typo

@OuYangJinTing Ok, I was able to checkout your branch and do some verification. LGTM. Can you please squash your commits? :bow:

OuYangJinTing

comment created time in 4 hours

pull request commentrails/rails

Add caching? helper method

@rafaelfranca @kaspth thanks for the reviews. I rewrote this PR to use ActiveSupport::PerThreadRegistry.

@kaspth what do you think about having both caching? and uncachable!?

joelhawksley

comment created time in 5 hours

pull request commentrails/rails

Skip logging backtrace when exception is in `rescue_responses`

@flavorjones now you're a co-author, feel free to add your name to the CHANGELOG as well 😊

flavorjones

comment created time in 5 hours

issue commentrails/rails

ETags don't take assets into account

You basically need to render the view to know what assets are linked, so you'd lose a huge part of the perf gain. You'd still save sending the body, but you would have rendered it.

Doh, of course. 🤦‍♂️

georgeclaghorn

comment created time in 5 hours

Pull request review commentrails/rails

Skip logging backtrace when exception is in `rescue_responses`

 module ActionDispatch   # This middleware is responsible for logging exceptions and   # showing a debugging page in case the request is local.   class DebugExceptions+    cattr_accessor :log_rescued_responses, default: true

you probably want instance_accessor: false here.

flavorjones

comment created time in 6 hours

issue closedrails/rails

FATAL Rails : ActiveRecord::ConnectionNotEstablished (could not translate host name "xxxx.us-east-1.rds.amazonaws.com" to address: System error)

I have recently migrated from Rails 4.2.1 to Rails 6.1.3.2 And getting this error frequently. It occurs multiple times in a day and reloading the ngnix configuration fixes it temporarily.

Earlier I had tried increasing pool size in my database.yml to 15. This change fixed this issue for some days but it started appearing again.

Expected behavior

Should connect to Database and fetch the relevant information.

Actual behavior

Thorws error

FATAL Rails :   
ActiveRecord::ConnectionNotEstablished (could not translate host name "xxxx.us-east-1.rds.amazonaws.com" to address: System error)

System configuration

Rails version: 6.1.3.2

Ruby version:3.0.1

closed time in 6 hours

vs37559

issue commentrails/rails

FATAL Rails : ActiveRecord::ConnectionNotEstablished (could not translate host name "xxxx.us-east-1.rds.amazonaws.com" to address: System error)

@vs37559 unless you are able to reproduce this in isolation, we can only assume it's an issue with your production setup and not with Rails. Feel free to keep this issue updated for anyone who would run into the same issue, but since it's not actionable for the Rails team I'll be closing it.

vs37559

comment created time in 6 hours

issue commentrails/rails

ETags don't take assets into account

Low-touch: incorporate all asset fingerprints into ETags for all cached HTML requests

I guess a digest of the manifest could be used as a seed. fresh_when already takes an option to digest the template that's supposed to be rendered, so it would fit.

More sophisticated: only assets explicitly linked from the view.

I don't think this one is worth it. You basically need to render the view to know what assets are linked, so you'd lose a huge part of the perf gain. You'd still save sending the body, but you would have rendered it.

georgeclaghorn

comment created time in 6 hours

Pull request review commentrails/rails

Skip logging backtrace when exception is in `rescue_responses`

 def log_error(request, wrapper)         return unless logger          exception = wrapper.exception+        return if !log_rescued_responses(request) && ActionDispatch::ExceptionWrapper.rescue_responses.key?(exception.class.name)

Done.

flavorjones

comment created time in 6 hours