# ArgumentError on model create statement

**URL:** <https://www.ruby-forum.com/t/argumenterror-on-model-create-statement/160930>\
**Category:** Rails\
**Created:** [February 21, 2009, 1:08am UTC](https://www.ruby-forum.com/t/argumenterror-on-model-create-statement/160930 "2009-02-21T01:08:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cpjolicoeur](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/a183cd/32.png) [@cpjolicoeur](https://www.ruby-forum.com/u/cpjolicoeur)\
**Post date:** [February 21, 2009, 1:08am UTC](https://www.ruby-forum.com/t/argumenterror-on-model-create-statement/160930/1 "2009-02-21T01:08:10Z")

</div>

I have a rails app model that I’m getting a strange error that is just  
baffling me. I’ve stripped everything out of my model down to the  
basics and still get the error.

So, here is the current model:

class Metric \< ActiveRecord::Base  
end

When I go into the console, and issue a simple “Metric.create” command I  
get the following error:

> > Metric.create  
> > ArgumentError: wrong number of arguments (1 for 0)  
> > from  
> > /src/parkassist/paseweb/vendor/rails/activerecord/lib/active\_record/callbacks.rb:288:in  
> > `callback' from /src/parkassist/paseweb/vendor/rails/activerecord/lib/active_record/callbacks.rb:288:in`valid?’  
> > from  
> > /src/parkassist/paseweb/vendor/rails/activerecord/lib/active\_record/validations.rb:1008:in  
> > `save_without_dirty' from /src/parkassist/paseweb/vendor/rails/activerecord/lib/active_record/dirty.rb:79:in`save\_without\_transactions’  
> > from  
> > /src/parkassist/paseweb/vendor/rails/activerecord/lib/active\_record/transactions.rb:179:in  
> > `send' from /src/parkassist/paseweb/vendor/rails/activerecord/lib/active_record/transactions.rb:179:in`with\_transaction\_returning\_status’  
> > from  
> > /src/parkassist/paseweb/vendor/rails/activerecord/lib/active\_record/connection\_adapters/abstract/database\_statements.rb:66:in  
> > `transaction' from /src/parkassist/paseweb/vendor/rails/activerecord/lib/active_record/transactions.rb:129:in`transaction’  
> > from  
> > /src/parkassist/paseweb/vendor/rails/activerecord/lib/active\_record/transactions.rb:138:in  
> > `transaction' from /src/parkassist/paseweb/vendor/rails/activerecord/lib/active_record/transactions.rb:178:in`with\_transaction\_returning\_status’  
> > from  
> > /src/parkassist/paseweb/vendor/rails/activerecord/lib/active\_record/transactions.rb:146:in  
> > `save' from /src/parkassist/paseweb/vendor/rails/activerecord/lib/active_record/transactions.rb:158:in`rollback\_active\_record\_state!’  
> > from  
> > /src/parkassist/paseweb/vendor/rails/activerecord/lib/active\_record/transactions.rb:146:in  
> > `save' from /src/parkassist/paseweb/vendor/rails/activerecord/lib/active_record/base.rb:693:in`create’  
> > from (irb):12

Any help? What am I missing and why does a simple create statement  
through this ArgumentError?

---

<div class="post-metadata">

**Author:** ![cpjolicoeur](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/a183cd/32.png) [@cpjolicoeur](https://www.ruby-forum.com/u/cpjolicoeur)\
**Post date:** [February 21, 2009, 9:52am UTC](https://www.ruby-forum.com/t/argumenterror-on-model-create-statement/160930/2 "2009-02-21T09:52:06Z")

</div>

On 21 Feb 2009, at 00:08, Craig J. wrote:

> I have a rails app model that I’m getting a strange error that is just  
> baffling me. I’ve stripped everything out of my model down to the  
> basics and still get the error.
> 
> So, here is the current model:
> 
> class Metric \< ActiveRecord::Base  
> end  
> Any plugins in that app that are extending activerecord ?

Fred

---

<div class="post-metadata">

**Author:** ![cpjolicoeur](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/a183cd/32.png) [@cpjolicoeur](https://www.ruby-forum.com/u/cpjolicoeur)\
**Post date:** [February 21, 2009, 3:03pm UTC](https://www.ruby-forum.com/t/argumenterror-on-model-create-statement/160930/3 "2009-02-21T15:03:21Z")

</div>

Thanks, but the plugins aren’t an issue. I found the problem.

I should have included my model attributes as well from the DB.

I had a DB column called “callback” which interfered with built-in AR  
functionality.

Frederick C. wrote:

> On 21 Feb 2009, at 00:08, Craig J. wrote:
> 
> > I have a rails app model that I’m getting a strange error that is just  
> > baffling me. I’ve stripped everything out of my model down to the  
> > basics and still get the error.
> > 
> > So, here is the current model:
> > 
> > class Metric \< ActiveRecord::Base  
> > end  
> > Any plugins in that app that are extending activerecord ?
> 
> Fred
