maeve/modelish — Issue #8: Type conversions are not applied for Modelish::Base#to_s
Author: maeve
Created: 2012-02-22 19:11:24+00:00
State: open
Labels: bug

Given the following modelish object:

```ruby
class MyModel < Modelish::Base
property :my_prop, :type => Integer
end

model = MyModel.new(:my_prop => "42")
```

When rendering the model as a string, the raw value is returned:

```ruby
model.to_s
# => "#"
```

Instead, it should render the property value after type conversion, like so:

```ruby
model.to_s
# => "#"
```

This is a relatively minor bug. However, it can certainly cause a lot of confusion in scenarios with more complex type conversion logic (for example, converting nested hashes into a graph of modelish objects).

The Modelish::Base#to_s method is currently borrowed from the hashie base class. It should be re-implemented to support modelish-specific concepts like property types.