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

with_deleted status #1

Open
webdevotion opened this issue Jan 17, 2011 · 6 comments
Open

with_deleted status #1

webdevotion opened this issue Jan 17, 2011 · 6 comments

Comments

@webdevotion
Copy link

Just curious about the status of with_deleted feature?
Using the gem in a project going from Rails 2.x to Rails 3.x.
Incompatiblity of with_deleted is a showstopper for us atm.

@jrom
Copy link
Contributor

jrom commented Jan 17, 2011

Can you please explain with more detail the issue? There's a with_deleted scope implemented, and also count_with_deleted and find_with_deleted methods to provide backwards compatibility.

@webdevotion
Copy link
Author

I'm getting
Unknown key(s): with_deleted

snippet from my model
class Document < ActiveRecord::Base
include Immortal

  # this used to work with acts_as_paranoid
  belongs_to :person,   :with_deleted => true
  belongs_to :project,  :with_deleted => true
....

@webdevotion
Copy link
Author

activesupport (3.0.3) lib/active_support/core_ext/hash/keys.rb:43:in `assert_valid_keys'
activerecord (3.0.3) lib/active_record/associations.rb:1772:in `create_belongs_to_reflection'
activerecord (3.0.3) lib/active_record/associations.rb:1220:in `belongs_to'
activerecord (3.0.3) lib/active_record/autosave_association.rb:137:in `belongs_to'
app/models/document.rb:6

@jrom
Copy link
Contributor

jrom commented Jan 17, 2011

Ok! Now I got you, :with_deleted in the association. This is not implemented, we discussed about this feature and decided that's better to have it explicitly called wherever you need that. If you really think this is necessary and would use it, feel free to contribute it.

@webdevotion
Copy link
Author

I would, if I would know where to start :)
Could you tell me what the alternative route would be in my case?
cfr. "to have it explicitly called wherever you need that"

@jrom
Copy link
Contributor

jrom commented Jan 17, 2011

Yes, just write person and project methods in your Document model that finds using the with_deleted scope.

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

2 participants