Displaying 20 results from an estimated 300 matches similar to: "acts_as_paranoid Unknown key(s): with_deleted"
2007 Aug 03
0
acts_as_paranoid and Association Extensions (has_one troubles)
Hi... Isn''t there a proper way or hack/workaround for the following?
* For the example with unfortunate disabilities.. look below,,,
Usage of has_* (associationmethods) do {def with_deleted
AccociatedModel#with_scope} {Paranoid''s#find_with_deleted}...
The has_one associations give me a nil object when invoking it with
Model.association_OBJECT.with_deleted. Has_many does like
2005 Dec 11
4
Problem with acts_as_paranoid: "ArgumentError: Unknown key(s): group"
Here''s the full error:
1) Error:
test_add_message_to_existing_ticket(TicketTest):
ArgumentError: Unknown key(s): group
/usr/lib/ruby/gems/1.8/gems/activesupport-1.2.4/lib/active_support/core_ext/hash/keys.rb:48:in
`assert_valid_keys''
/usr/lib/ruby/gems/1.8/gems/acts_as_paranoid-0.2/lib/acts_as_paranoid.rb:125:in
`validate_find_options''
2006 Mar 02
4
Getting Acts_as_Paranoid to work with validates_uniqueness_of
Hello
I''ve been using Acts_as_Parnoid for a while and it has been working well
but I am now having a slight issue with it. I have a company table were
I would like to use validates_uniqueness_of :company_name. This
validation works if a company exists in the database and has not been
deleted. However, I also would like the validates_uniqueness_of to
work if a company has
2006 May 11
0
acts_as_paranoid, aliasing and nested scopes in Rails 1.1
I have a real problem with the acts_as_paranoid plugin. The aliasing of
find and so the nested scope does not seem to work at all, when
combining it with similar plugins.
The description:
I made a copy of ''acts_as_paranoid'' in the plugin directory, renamed it
to ''acts_as_very_new''(just a nonsense plugin for testing), and
simplified the code (original code
2007 Jan 28
0
problems with acts_as_paranoid (noticed while using acts_as_versioned)
hello,
I''m using the trunk versions of both plugins.
I''m running into this error when I run a migration to try and create
the versioned table for the model ''Note''
stack level too deep
/Users/Adam/dev/sweetspot/app/trunk/config/../vendor/plugins/
acts_as_paranoid/init.rb:5:in `belongs_to_without_deleted''
2006 Aug 16
0
acts_as_paranoid and alias_method_chain
when i require acts_as_paranoid I''m getting: undefined method
`alias_method_chain'' for #<Class:ActiveRecord::Base> (NoMethodError)
It happens in acts_as_paranoid''s init.rb. here''s the whole file. the
alias_method_chain is near the bottom. please advise.
class << ActiveRecord::Base
def belongs_to_with_deleted(association_id, options = {})
2006 Mar 14
2
acts_as_paranoid and :include
Will the find from acts_as_paranoid filter down to an :include?
For instance
class parent
acts_as_paranoid
has_many: children
end
and
class child
acts_as_paranoid
belongs_to :parent
end
Then if you
Parent.find(:all, :include => children)
you will get all the children if they are deleted or not. I guess the find
that filters out the deleted_at is null does not filter down to the includes
2006 Mar 27
3
act_as_paranoid and model references
I''m using act_as_paranoid plugin for most of my models. One of the
reasons was that I didn''t want to break references between objects
after I "deleted" an object. One of the cases was to know which user
modified something even after I deleted the user.
My problem now is that I cannot access the user after it was deleted
if I use the :has_and_belongs_to :user
2006 May 20
1
acts_as_paranoid overrides ActiveRecord::Base??
Guys,
I am trying to figure out what exactly does this line do at the end of
"acts_as_paranoid" plugin?
ActiveRecord::Base.send :include, Caboose::Acts::Paranoid::ActiveRecord
My problem: I have some classes that I use acts_as_paranoid, and others
with tagging support. Classes declared as taggable, throw error, which
appears to be in the acts_as_paranoid version of the
2007 Jan 08
2
Two problems with Acts_as_paranoid
Hi,
I''ve run into two small problems with acts_as_paranoid and wondered if
anyone else has experienced them as well (and if yes, if they have any
solutions).
1. When using has_many :through, AAP doesn''t seem to take into account
the fact that your join model might also be paranoid. My solution to
this at the moment is to add an explicit conditions clause to the
has_many
2005 Dec 21
0
acts_as_paranoid updated for Rails 1.0
Just to let the folks that are tracking Acts as Paranoid know, I''ve
updated it to v0.3.1 and verified it passes for Rails 1.0. I had to
remove the code that lets deleted items select associated deleted
items unfortunately. It overwrote too much in the base association
classes and caused some breakage. I say if you want to use your
deleted models, undelete them and use them. Or:
2006 Jul 10
0
Strange acts_as_paranoid behavior
Using the acts_as_paranoid plugin with rails 1.1.4 (model also uses
acts_as_threaded and acts_as_taggable) and getting some unexplainable behavior.
The following tests:
assert_equal Conv.count, num
assert_equal Conv.count_with_deleted, CONVS_TOTAL
Produce the following SQL:
SQL (0.000000) SELECT count(*) AS count_all FROM convs WHERE ((
convs.deleted_at IS NULL OR convs.deleted_at
2006 Jan 31
2
find_by_sql question
I''m no good at SQL and I have a question that will hopefully be fairly
easy to answer.
I''m using acts_as_paranoid which instead of deleting a record adds a
deleted_at column with the datetime the row was deleted. I want to have
a find_by_sql filter out any row where deleted_at is not null.
I have (at least the relevant parts):
#a couple working filters here.
filters <<
2008 Feb 12
0
acts_as_paranoid: has_one_paranoid
Hi all,
Ran in to a problem with AR::B#find(:include) and acts_as_paranoid,
well described here:
http://www.ruby-forum.com/topic/57945
So I whipped up this thing, which seems to work for me:
module ActiveRecord
class Base
def self.has_one_paranoid(*args)
ref = create_has_one_reflection *args
cond = args.last[:conditions]
cond = cond.blank? ? '''' : cond
2009 Nov 20
7
Soft Deletes
Hello all,
I am wondering how people here are handling soft deletes in Rails.
I''ve need a couple of gems/plugins that seem to handle this but from
what I gather development has stopped on them.
All I need to do right now is mark something as deleted in the
DB...nothing fancy.
I''m thinking that the simple addition of a deleted_at column, some
named scopes (maybe even a default
2006 Aug 06
5
Return only results that user is allowed to see?
Is it possible with acts_as_ferret to somehow restrict the results that
are returned?
For instance, I don''t want to return results that are logically deleted
with acts_as_paranoid (deleted_at IS NOT NULL and deleted_at < now()).
Also, if a user is not an Admin, they should not be able to return
results that have a certain value in a certain column, like forum_id !=
13 (if 13 is
2009 May 19
0
Extending finders to include a session variable as an option??
We have a Page model which acts_as_paranoid.
AAP modifies ActiveRecord finders to ignore any records marked as
deleted unless the :with_deleted => true option is supplied.
We have a UI element which allows users to toggle whether or not to
display deleted Pages, their current setting being stored in a session
variable, session[:show_deleted].
What we would like is to automagically have
2007 May 11
3
is_active?
Hey all, i''m rather new to rails and was curious if ActiveRecord
implemented anything like is_active where the delete functions would
just mark records as inactive, vs deleting rows. (similar to created_at,
etc). I need a history of transactions, and this is how I would code in
other languages. Any advice? Is there are smarter way to implement this?
Thanks in advance!
--
Posted via
2006 Mar 24
6
Should counter_cache fields be saved in the database?
As far as I can tell, the counter_cache option on a belongs_to model
doesn''t actually save anything in the database. For example, I have
the following models:
class Parent < ActiveRecord::Base
has_many :children,
:conditions => "deleted_at IS NULL"
end
class Child < ActiveRecord::Base
belongs_to :parent, :counter_cache => true
end
With the following
2008 Feb 13
4
Migration Issues: Can't update newly added column values
Hello everyone, just wondering if anyone can help me with a migrations
question here.
Using:
rails 2.0.2
ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin]
mysql 5.0.45
Platform:
windows xp
The problem:
----------
I created a migration that is designed to add a column named
"deleted_at" (timestamp) and then remove a column named
"is_deleted" (boolean). The idea is to