# Validations.rb:81 error

**URL:** <https://www.ruby-forum.com/t/validations-rb-81-error/117134>\
**Category:** Rails\
**Created:** [October 13, 2007, 3:33pm UTC](https://www.ruby-forum.com/t/validations-rb-81-error/117134 "2007-10-13T15:33:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![pedz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/839c29/32.png) [@pedz](https://www.ruby-forum.com/u/pedz)\
**Post date:** [October 13, 2007, 3:33pm UTC](https://www.ruby-forum.com/t/validations-rb-81-error/117134/1 "2007-10-13T15:33:59Z")

</div>

In my Mongrel logs, I am getting this:

…active\_record/validations.rb:81: warning: Object#type is deprecated;  
use Object#class

That piece of code is:

```
def add_on_blank(attributes, msg = @@default_error_messages[:blank])
  for attr in [attributes].flatten
    value = @base.respond_to?(attr.to_s) ? @base.send(attr.to_s) :

```

@base[attr.to\_s] \<\<\< line 81  
add(attr, msg) if value.blank?  
end  
end

I don’t see what Ruby is complaining about. Anyone have any ideas?

Thanks,  
pedz

---

<div class="post-metadata">

**Author:** ![pedz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/839c29/32.png) [@pedz](https://www.ruby-forum.com/u/pedz)\
**Post date:** [October 13, 2007, 8:12pm UTC](https://www.ruby-forum.com/t/validations-rb-81-error/117134/2 "2007-10-13T20:12:33Z")

</div>

just a guess, but have you given any of your models a “type” field in  
the database? rails by default will think that your model is using  
STI if you have a “type” field.

On Oct 13, 9:33 am, Perry S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![pedz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/839c29/32.png) [@pedz](https://www.ruby-forum.com/u/pedz)\
**Post date:** [October 14, 2007, 1:08am UTC](https://www.ruby-forum.com/t/validations-rb-81-error/117134/3 "2007-10-14T01:08:25Z")

</div>

Jeff Emminger wrote:

> just a guess, but have you given any of your models a “type” field in  
> the database? rails by default will think that your model is using  
> STI if you have a “type” field.
> 
> On Oct 13, 9:33 am, Perry S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

Thanks but, no… I don’t see just a “type” field. I looked in my  
migrate files and then I did a rake db:schema:dump and looked in the  
dump file. I have things like “item\_type” but not just “type”.

I’m using edge rails – if that matters.

---

<div class="post-metadata">

**Author:** ![pedz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/839c29/32.png) [@pedz](https://www.ruby-forum.com/u/pedz)\
**Post date:** [October 14, 2007, 1:12am UTC](https://www.ruby-forum.com/t/validations-rb-81-error/117134/4 "2007-10-14T01:12:23Z")

</div>

Perry S. wrote:

> Jeff Emminger wrote:
> 
> > just a guess, but have you given any of your models a “type” field in  
> > the database? rails by default will think that your model is using  
> > STI if you have a “type” field.
> > 
> > On Oct 13, 9:33 am, Perry S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
> 
> Thanks but, no… I don’t see just a “type” field. I looked in my  
> migrate files and then I did a rake db:schema:dump and looked in the  
> dump file. I have things like “item\_type” but not just “type”.
> 
> I’m using edge rails – if that matters.

I might have found it. I use to have a field “type” but I changed it.  
But I goofed and did not change my “validates\_presence\_of :type”.

I bet thats it.

Thanks.

---

<div class="post-metadata">

**Author:** ![pedz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/839c29/32.png) [@pedz](https://www.ruby-forum.com/u/pedz)\
**Post date:** [October 14, 2007, 4:57am UTC](https://www.ruby-forum.com/t/validations-rb-81-error/117134/5 "2007-10-14T04:57:40Z")

</div>

aha… you should have caught that in your unit tests 😉

On Oct 13, 7:12 pm, Perry S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
