Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't override belongs_to_required_by_default #116

Open
masaru-tech opened this issue Oct 18, 2017 · 2 comments
Open

Don't override belongs_to_required_by_default #116

masaru-tech opened this issue Oct 18, 2017 · 2 comments

Comments

@masaru-tech
Copy link

masaru-tech commented Oct 18, 2017

Don't override belongs_to_required_by_default when use activerecord-session_store.

use activerecord-session_store revision: b5e7da2

[config/application.rb]
module AppName
  class Application < Rails::Application
    # Initialize configuration defaults for originally generated Rails version.
    config.load_defaults 5.1

[config/initializers/new_framework_defaults.rb]
# Require `belongs_to` associations by default. Previous versions had false.
Rails.application.config.active_record.belongs_to_required_by_default = false

In rails console:

> ActiveRecord::Base.belongs_to_required_by_default
=> true
> Rails.application.config.active_record.belongs_to_required_by_default
=> false

When activerecord-session_store no use

In rails console:

> ActiveRecord::Base.belongs_to_required_by_default
=> false
> Rails.application.config.active_record.belongs_to_required_by_default
=> false
@masaru-tech masaru-tech changed the title Not override belongs_to_required_by_default Don't override belongs_to_required_by_default Oct 19, 2017
ta1kt0me added a commit to ta1kt0me/todo-test that referenced this issue Dec 5, 2017
```
irb(main):001:0> ActiveRecord::Base.belongs_to_required_by_default
=> true
irb(main):002:0> Rails.application.config.active_record.belongs_to_required_by_default
=> false
```
@minimum2scp
Copy link

I also encountered same problem.
And it seems to be resolved by #126, but new version is not released yet.

@sikachu or @kaspth or someone else,
could you release new version?

@h0jeZvgoxFepBQ2C
Copy link

I guess a new version has been released since then, so this issue can be closed? @sikachu @rafaelfranca

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants