# Problem with acts\_as\_paranoid: "ArgumentError: Unknown key(s

**URL:** <https://www.ruby-forum.com/t/problem-with-acts-as-paranoid-argumenterror-unknown-key-s/49970>\
**Category:** Rails\
**Created:** [December 11, 2005, 7:43am UTC](https://www.ruby-forum.com/t/problem-with-acts-as-paranoid-argumenterror-unknown-key-s/49970 "2005-12-11T07:43:06Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![pergesu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/22d042/32.png) [@pergesu](https://www.ruby-forum.com/u/pergesu)\
**Post date:** [December 11, 2005, 7:43am UTC](https://www.ruby-forum.com/t/problem-with-acts-as-paranoid-argumenterror-unknown-key-s/49970/1 "2005-12-11T07:43:06Z")

</div>

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’  
/usr/lib/ruby/gems/1.8/gems/activerecord-1.13.1/lib/active\_record/base.rb:1164:in  
`extract_options_from_args!' /usr/lib/ruby/gems/1.8/gems/acts_as_paranoid-0.2/lib/acts_as_paranoid.rb:62:in`find’  
/usr/lib/ruby/gems/1.8/gems/activerecord-1.13.1/lib/active\_record/associations/has\_many\_association.rb:111:in  
`find_target' /usr/lib/ruby/gems/1.8/gems/activerecord-1.13.1/lib/active_record/associations/association_proxy.rb:81:in`load\_target’  
/usr/lib/ruby/gems/1.8/gems/activerecord-1.13.1/lib/active\_record/associations/association\_collection.rb:20:in  
`<<' ./test/unit/ticket_test.rb:62:in`test\_add\_message\_to\_existing\_ticket’

The code in question:  
t.messages \<\< Message.new({ :body =\> “ya message body”, :user =\>  
users(:bob) })

t is a Ticket object, and a Ticket has\_many :messages. Both Ticket  
and Message mixin acts\_as\_paranoid. I also get the same error if I  
call Ticket#destroy.

I think this may have been asked on the list already, but I can’t find  
anything in gmane, ruby-forum, or google so I’m lost.

Pat

---

<div class="post-metadata">

**Author:** ![pergesu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/22d042/32.png) [@pergesu](https://www.ruby-forum.com/u/pergesu)\
**Post date:** [December 13, 2005, 6:05pm UTC](https://www.ruby-forum.com/t/problem-with-acts-as-paranoid-argumenterror-unknown-key-s/49970/2 "2005-12-13T18:05:57Z")

</div>

Pat M. wrote:

> 1. Error:  
> test\_add\_message\_to\_existing\_ticket(TicketTest):  
> ArgumentError: Unknown key(s): group

…

> anything in gmane, ruby-forum, or google so I’m lost.  
> I just ran into this same problem. You need to edit acts\_as\_paranoid.rb.  
> In the validate\_find\_options method (line 125) add the symbol :group.

Here’s how the method originally appears:

def validate\_find\_options(options)  
options.assert\_valid\_keys [:conditions, :include, :joins, :limit, :  
offset, :order, :select, :readonly, :with\_deleted]  
end

and here is the edited version:

def validate\_find\_options(options)  
options.assert\_valid\_keys [:conditions, :include, :joins, :limit, :  
offset, :order, :select, :readonly, :group, :with\_deleted]  
end

Ideally I suppose acts\_as\_paranoid would somehow figure out the keys  
that ActiveRecord finds acceptable, then append :with\_deleted on to the  
lsit, but I don’t know how one would do that.

Someone already submitted a patch to fix this problem here:

[http://rubyforge.org/tracker/index.php?func=detail&aid=2870&group\_id=944&atid=3711](http://rubyforge.org/tracker/index.php?func=detail&aid=2870&group_id=944&atid=3711)

-F

---

<div class="post-metadata">

**Author:** ![pergesu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/22d042/32.png) [@pergesu](https://www.ruby-forum.com/u/pergesu)\
**Post date:** [December 13, 2005, 6:45pm UTC](https://www.ruby-forum.com/t/problem-with-acts-as-paranoid-argumenterror-unknown-key-s/49970/3 "2005-12-13T18:45:26Z")

</div>

> and here is the edited version:  
> Someone already submitted a patch to fix this problem here:
> 
> [http://rubyforge.org/tracker/index.php?func=detail&aid=2870&group\_id=944&atid=3711](http://rubyforge.org/tracker/index.php?func=detail&aid=2870&group_id=944&atid=3711)

It’s in SVN along with a few more additions. I’m just waiting for  
Rails 1.0 so I can release aap v0.3 and piggy back on the tidal wave  
of interest.

[http://techno-weenie.net/svn/projects/plugins/acts\_as\_paranoid](http://techno-weenie.net/svn/projects/plugins/acts_as_paranoid)

Someday I’ll probably move that to RubyForge’s SVN repo too.

–  
rick  
[http://techno-weenie.net](http://techno-weenie.net)

---

<div class="post-metadata">

**Author:** ![pergesu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/22d042/32.png) [@pergesu](https://www.ruby-forum.com/u/pergesu)\
**Post date:** [December 13, 2005, 10:16pm UTC](https://www.ruby-forum.com/t/problem-with-acts-as-paranoid-argumenterror-unknown-key-s/49970/4 "2005-12-13T22:16:50Z")

</div>

Rick O. wrote:

> It’s in SVN along with a few more additions. I’m just waiting for  
> Rails 1.0 so I can release aap v0.3 and piggy back on the tidal wave  
> of interest.
> 
> [http://techno-weenie.net/svn/projects/plugins/acts\_as\_paranoid](http://techno-weenie.net/svn/projects/plugins/acts_as_paranoid)
> 
> Someday I’ll probably move that to RubyForge’s SVN repo too.

If you don’t plan on making any other changes before 1.0, I’d encourage  
you to release this now. It’s frustrating to spend the time tracking  
down a bug and then find out it’s been fixed previously.

Also, the SVN repository linked from the README at the URL  
[http://ar-paranoid.rubyforge.org/](http://ar-paranoid.rubyforge.org/) returns a 404.

Thanks for the plugin!

-F

---

<div class="post-metadata">

**Author:** ![pergesu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/22d042/32.png) [@pergesu](https://www.ruby-forum.com/u/pergesu)\
**Post date:** [December 13, 2005, 10:52pm UTC](https://www.ruby-forum.com/t/problem-with-acts-as-paranoid-argumenterror-unknown-key-s/49970/5 "2005-12-13T22:52:58Z")

</div>

Finn S. wrote:

> Rick O. wrote:
> 
> > It’s in SVN along with a few more additions. I’m just waiting for  
> > Rails 1.0 so I can release aap v0.3 and piggy back on the tidal wave  
> > of interest.
> 
> If you don’t plan on making any other changes before 1.0, I’d encourage  
> you to release this now.

Well this was a poorly timed comment seeing as Rails went 1.0 a few  
hours after I wrote this.

-F
