similar to: Two problems with Acts_as_paranoid

Displaying 20 results from an estimated 3000 matches similar to: "Two problems with Acts_as_paranoid"

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
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''
2008 Apr 15
1
acts_as_paranoid Unknown key(s): with_deleted
Trying this straight from the README: I have acts_as_paranoid in my model (Course), and added the deleted_at column. This is OK: Course.find_with_deleted(:all) Course.find(:all, :with_deleted => true) gives: ArgumentError: Unknown key(s): with_deleted from /opt/local/lib/ruby/gems/1.8/gems/activesupport-2.0.2/lib/ active_support/core_ext/hash/keys.rb:49:in `assert_valid_keys''
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 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 <<
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
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
2005 Nov 15
1
acts_as_paranoid --> undefined method `constrain' for class `Class'
Hi All, So I thought I had this acts_as_paranoid problem previously and fixed by going to rails 0.14.2, although I''m not 100% it was the same thing. I''m now on rails 0.14.3 and I''m getting: undefined method `constrain'' for class `Class'' for any model that includes acts_as_paranoid. My application trace is below. Has anyone else got this and know a
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
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
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
2008 Sep 25
1
Will acts_as_paranoid work with attachment_fu?
I''ve got a problem in that users are deleting a paranoid model through the application, including dependents. Some of these dependents are paranoid too, but not the attachments. (I''m using DB file storage.) I need to be able to un-delete these things and I''m now wondering if acts_as_paranoid will work with models that use attachment_fu? If so, in what model to I add the
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
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
2008 Apr 17
4
acts_as_paranoid is making me crazy
Acts_as_paranoid is giving me a headache when performing migrations. For some reason when I perform a migration I get a "stack level too deep" error. If I comment out the database inserts that are performed (countries, regions, and a base admin) it works well. Even after minimizing the data that is inserted on the migration to one record it still throws the same error. When running
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
2006 Jan 10
15
KISS and DRY? Not even close!
Hi all, After working on my first rails app and having handed over some very sophisticated coding from a lot of you guys. My app does what I want it to do, but I''m no where near the end yet, and it seems that the KISS and DRY objectives already went down the drain. It could be lack of knowledge, only doing Ruby on (and) Rails for a month, but I''m stuck on the following:
2007 Sep 05
1
(no subject)
unsubscribe ____________________ Christopher Swingler System Administrator Cappex.com - Where colleges apply to you! cswingler at cappex.com<mailto:email at cappex.com> 847-748-9014 x7301 (p) (847) 433-7059 (f) -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.centos.org/pipermail/centos/attachments/20070905/16131036/attachment.html>
2007 Feb 20
1
Urls generated by nested map.resources
Hi, Apologies if this has been answered before. I have just started to try out the new RESTful routes. For resources that aren''t related to anything else, everything makes sense - for resources with relationships, I am less certain of what the "right" thing to do - especially in relation to the urls produced, and how to modify those urls. For example, if I have teams and