# ActionWebService : decimal is not a valid base type

**URL:** <https://www.ruby-forum.com/t/actionwebservice-decimal-is-not-a-valid-base-type/84250>\
**Category:** Rails\
**Created:** [February 2, 2007, 6:06pm UTC](https://www.ruby-forum.com/t/actionwebservice-decimal-is-not-a-valid-base-type/84250 "2007-02-02T18:06:50Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![giantcranes](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/ecd19e/32.png) [@giantcranes](https://www.ruby-forum.com/u/giantcranes)\
**Post date:** [February 2, 2007, 6:06pm UTC](https://www.ruby-forum.com/t/actionwebservice-decimal-is-not-a-valid-base-type/84250/1 "2007-02-02T18:06:50Z")

</div>

Hi,

I have searched for an answer to this, and have found a ticket which  
seems to address the error:

[http://dev.rubyonrails.org/ticket/6676](http://dev.rubyonrails.org/ticket/6676)

I am, however, getting a ‘decimal is not a valid base type’ error when  
trying to return an ActiveRecord model which has a decimal value.

Agile Web D. with Rails v2 does not list decimal as a supported  
parameter type. Is decimal supported? If not, how should this be solved?

Thanks,  
GiantCranes

---

<div class="post-metadata">

**Author:** ![giantcranes](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/ecd19e/32.png) [@giantcranes](https://www.ruby-forum.com/u/giantcranes)\
**Post date:** [February 2, 2007, 6:15pm UTC](https://www.ruby-forum.com/t/actionwebservice-decimal-is-not-a-valid-base-type/84250/2 "2007-02-02T18:15:57Z")

</div>

On 2/2/07, Giant C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Agile Web D. with Rails v2 does not list decimal as a supported  
> parameter type. Is decimal supported? If not, how should this be solved?
> 
> Thanks,  
> GiantCranes

Decimal is not a valid base type - use float in your parameter  
signature.

–  
Zack C.  
[http://depixelate.com](http://depixelate.com)

---

<div class="post-metadata">

**Author:** ![giantcranes](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/ecd19e/32.png) [@giantcranes](https://www.ruby-forum.com/u/giantcranes)\
**Post date:** [February 2, 2007, 6:29pm UTC](https://www.ruby-forum.com/t/actionwebservice-decimal-is-not-a-valid-base-type/84250/3 "2007-02-02T18:29:00Z")

</div>

On 2/2/07, Giant C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Is it possible to override the decimal type at this level? If not, where  
> should I do this?

It’s a bug. I ran into it in rc1 with postgresql and filed a ticket a  
while ago. Been long enough I can’t remember how I worked around it.

Chris

---

<div class="post-metadata">

**Author:** ![giantcranes](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/ecd19e/32.png) [@giantcranes](https://www.ruby-forum.com/u/giantcranes)\
**Post date:** [February 2, 2007, 6:23pm UTC](https://www.ruby-forum.com/t/actionwebservice-decimal-is-not-a-valid-base-type/84250/4 "2007-02-02T18:23:25Z")

</div>

> Decimal is not a valid base type - use float in your parameter  
> signature.

Thanks. My return type is an array of ActiveRecord objects, and they  
have a decimal type defined. My api\_method is:

api\_method :get\_vehicles, :returns =\> [[Vehicle]]

Is it possible to override the decimal type at this level? If not, where  
should I do this?

Thanks,  
GiantCranes

---

<div class="post-metadata">

**Author:** ![giantcranes](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/ecd19e/32.png) [@giantcranes](https://www.ruby-forum.com/u/giantcranes)\
**Post date:** [February 2, 2007, 6:57pm UTC](https://www.ruby-forum.com/t/actionwebservice-decimal-is-not-a-valid-base-type/84250/5 "2007-02-02T18:57:34Z")

</div>

> It’s a bug. I ran into it in rc1 with postgresql and filed a ticket a  
> while ago. Been long enough I can’t remember how I worked around it.

Thanks, I notice that it was addressed in changeset 5670 and this hasn’t  
made it into 1.2.1.

[http://dev.rubyonrails.org/changeset/5670](http://dev.rubyonrails.org/changeset/5670)

I’m not sure what to do now. I could change my db schema to use floats  
instead of decimal. I could also use edge rails. I’m relatively new to  
rails, any suggestions?

---

<div class="post-metadata">

**Author:** ![giantcranes](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/ecd19e/32.png) [@giantcranes](https://www.ruby-forum.com/u/giantcranes)\
**Post date:** [February 2, 2007, 7:00pm UTC](https://www.ruby-forum.com/t/actionwebservice-decimal-is-not-a-valid-base-type/84250/6 "2007-02-02T19:00:03Z")

</div>

The ticket [http://dev.rubyonrails.org/ticket/6676](http://dev.rubyonrails.org/ticket/6676) has been closed, but  
changes have not been merged into rails 1.2 branch.

On 2/2/07, Giant C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> 

## – Kent

> **[DATANOISE.COM](https://www.datanoise.com)**
>
> DATANOISE.COM - Contact us for any business inquiries

---

<div class="post-metadata">

**Author:** ![giantcranes](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/ecd19e/32.png) [@giantcranes](https://www.ruby-forum.com/u/giantcranes)\
**Post date:** [April 17, 2007, 3:15pm UTC](https://www.ruby-forum.com/t/actionwebservice-decimal-is-not-a-valid-base-type/84250/7 "2007-04-17T15:15:21Z")

</div>

Hi, I am now facing the same problem, and I want to ask you, if you’ve  
found a solution?

I use rails 1.2.3 and I am horribly new at ruby and rails, so it would  
be great, if you could give me a hint 😉

regards  
Katya

On 2 Feb., 20:02, Giant C. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![giantcranes](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/ecd19e/32.png) [@giantcranes](https://www.ruby-forum.com/u/giantcranes)\
**Post date:** [February 2, 2007, 7:02pm UTC](https://www.ruby-forum.com/t/actionwebservice-decimal-is-not-a-valid-base-type/84250/8 "2007-02-02T19:02:46Z")

</div>

Kent S. wrote:

> The ticket [http://dev.rubyonrails.org/ticket/6676](http://dev.rubyonrails.org/ticket/6676) has been closed, but  
> changes have not been merged into rails 1.2 branch.

Ok, I am going to take a deep breath and jump over onto edge rails.
