# Model with self.abstract\_class=true allows save method call

**URL:** <https://www.ruby-forum.com/t/model-with-self-abstract-class-true-allows-save-method-call/66231>\
**Category:** Rails\
**Created:** [August 24, 2006, 4:54am UTC](https://www.ruby-forum.com/t/model-with-self-abstract-class-true-allows-save-method-call/66231 "2006-08-24T04:54:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![weyus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/7ab992/32.png) [@weyus](https://www.ruby-forum.com/u/weyus)\
**Post date:** [August 24, 2006, 4:54am UTC](https://www.ruby-forum.com/t/model-with-self-abstract-class-true-allows-save-method-call/66231/1 "2006-08-24T04:54:56Z")

</div>

I think this is a bug.

I declared a model with self.abstract\_class = true and then tried to  
call save on it and it attempted the save. I think this should raise a  
“method not allowed” exception of some sort.

Where is the Trac system that I would use to report this?

Thanks,  
Wes

---

<div class="post-metadata">

**Author:** ![weyus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/7ab992/32.png) [@weyus](https://www.ruby-forum.com/u/weyus)\
**Post date:** [August 24, 2006, 5:10am UTC](https://www.ruby-forum.com/t/model-with-self-abstract-class-true-allows-save-method-call/66231/2 "2006-08-24T05:10:59Z")

</div>

OK, so I was totally doing this to see if I could use an abstract model  
and do validation on it even though there was no backing store.

As it turns out, you can. But…the save, create, or update will  
generate an error. Which, of course you can ignore if you don’t use the  
“bang” version of those methods.

Trying to decide if it’s worth it.

Obviously, I could store the model data, but this isn’t really something  
that I need to store.

Wes

---

<div class="post-metadata">

**Author:** ![weyus](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/7ab992/32.png) [@weyus](https://www.ruby-forum.com/u/weyus)\
**Post date:** [August 24, 2006, 5:42am UTC](https://www.ruby-forum.com/t/model-with-self-abstract-class-true-allows-save-method-call/66231/3 "2006-08-24T05:42:48Z")

</div>

A better way to do this…

Just call model.valid? which will call the validators without attempting  
to save the model object.

WG
