-
Notifications
You must be signed in to change notification settings - Fork 528
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
Installing gem breaks ActiveRecord 5 default 'required' behaviour #335
Comments
I'm going to go ahead and close this as this is not a paranoid specific bug - having narrowed it down it seems the cause is the re-opening of the ActiveRecord::Base class at some stage of the Rails initialisation process. I was able to reproduce the issue simply by re-opening the class in my Rails application.rb: require 'rails/all'
class ActiveRecord::Base
end
# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups) |
It looks like the recommendation from @rafaelfranca is to use If that sounds like an acceptable solution to the |
@fusion2004 if you could make a PR, that would be awesome :) |
@BenMorganIO Sure, I will take a crack at it by tomorrow night. |
@fusion2004 any updates on this? |
For easy access to a solution: Moving The above issue referenced says it's an initialization order issue and from what I gather it's not necessarily a paranoia issue. |
@iaankrynauw if that's so, would it be OK to close this issue then? |
@fusion2004 if you'd still like to submit a patch, that'd be nice too ;) |
Looks to me like @fusion2004's |
@iaankrynauw Thanks 👍 |
See #371 |
…od and joining tables that have a scope on `with_deleted` Update homepage in gemspec The homepage is supposed to be where you can find the code. It is displayed on rubygems.org page. Currently it will redirect you back to the same page. Should point at this github repo. Update README to use proper version for Rails 5 Version 2.2.0 Ignore failures from all jruby's on travis Add explicit language about dependent: :destroy Update CHANGELOG.md update ruby and rails versions Use ActiveSupport.on_load to correctly re-open ActiveRecord::Base. rubysherpas#335 Touch record on paranoia-destroy. Fixes rubysherpas#296 Touch record on destroy by leveraging the paranoia_destroy_attributes. Applied the same to the restore-method as this eliminates the extra query.
…od and joining tables that have a scope on `with_deleted` Update homepage in gemspec The homepage is supposed to be where you can find the code. It is displayed on rubygems.org page. Currently it will redirect you back to the same page. Should point at this github repo. Update README to use proper version for Rails 5 Version 2.2.0 Ignore failures from all jruby's on travis Add explicit language about dependent: :destroy Update CHANGELOG.md update ruby and rails versions Use ActiveSupport.on_load to correctly re-open ActiveRecord::Base. rubysherpas#335 Touch record on paranoia-destroy. Fixes rubysherpas#296 Touch record on destroy by leveraging the paranoia_destroy_attributes. Applied the same to the restore-method as this eliminates the extra query.
…od and joining tables that have a scope on `with_deleted` Update homepage in gemspec The homepage is supposed to be where you can find the code. It is displayed on rubygems.org page. Currently it will redirect you back to the same page. Should point at this github repo. Update README to use proper version for Rails 5 Version 2.2.0 Ignore failures from all jruby's on travis Add explicit language about dependent: :destroy Update CHANGELOG.md update ruby and rails versions Use ActiveSupport.on_load to correctly re-open ActiveRecord::Base. rubysherpas#335 Touch record on paranoia-destroy. Fixes rubysherpas#296 Touch record on destroy by leveraging the paranoia_destroy_attributes. Applied the same to the restore-method as this eliminates the extra query.
…od and joining tables that have a scope on `with_deleted` Update homepage in gemspec The homepage is supposed to be where you can find the code. It is displayed on rubygems.org page. Currently it will redirect you back to the same page. Should point at this github repo. Update README to use proper version for Rails 5 Version 2.2.0 Ignore failures from all jruby's on travis Add explicit language about dependent: :destroy Update CHANGELOG.md update ruby and rails versions Use ActiveSupport.on_load to correctly re-open ActiveRecord::Base. rubysherpas#335 Touch record on paranoia-destroy. Fixes rubysherpas#296 Touch record on destroy by leveraging the paranoia_destroy_attributes. Applied the same to the restore-method as this eliminates the extra query.
…od and joining tables that have a scope on `with_deleted` Update homepage in gemspec The homepage is supposed to be where you can find the code. It is displayed on rubygems.org page. Currently it will redirect you back to the same page. Should point at this github repo. Update README to use proper version for Rails 5 Version 2.2.0 Ignore failures from all jruby's on travis Add explicit language about dependent: :destroy Update CHANGELOG.md update ruby and rails versions Use ActiveSupport.on_load to correctly re-open ActiveRecord::Base. rubysherpas#335 Touch record on paranoia-destroy. Fixes rubysherpas#296 Touch record on destroy by leveraging the paranoia_destroy_attributes. Applied the same to the restore-method as this eliminates the extra query.
…od and joining tables that have a scope on `with_deleted` Update homepage in gemspec The homepage is supposed to be where you can find the code. It is displayed on rubygems.org page. Currently it will redirect you back to the same page. Should point at this github repo. Update README to use proper version for Rails 5 Version 2.2.0 Ignore failures from all jruby's on travis Add explicit language about dependent: :destroy Update CHANGELOG.md update ruby and rails versions Use ActiveSupport.on_load to correctly re-open ActiveRecord::Base. rubysherpas#335 Touch record on paranoia-destroy. Fixes rubysherpas#296 Touch record on destroy by leveraging the paranoia_destroy_attributes. Applied the same to the restore-method as this eliminates the extra query.
In Rails 5, associations are required by default.
After installing the paranoia gem, all of my specs that test this behaviour fail. I haven't explicitly required it anywhere (it is required by bundler) and I haven't added
acts_as_paranoid
to any of my models.I can fix my specs by explicitly adding
required: true
to my associations but this should not be necessary.The text was updated successfully, but these errors were encountered: