Brian Cowdery wrote:
> Hi Patrick,
> so for your specific example...
> 
>> hey all,
>> I have a table like that:
>> devices(
>> id int(5)
>> uid int(5)
>> type varchar(5)
>> )
> 
> 
> Your model should look like this
> 
> class Rdevice < ActiveRecord::Base
>  set_table_name "devices"
>  set_inheritance_column :ruby_type
> 
>  # getter for the "type" column
>  def device_type
>   self[:type]
>  end
> 
>  # setter for the "type" column
>  def device_type=(s)
>   self[:type] = s
>  end
> end
> 
> Enjoy!
> -Brian

Hi Brian,

That's a nice solution to the issue, even I was stuck with the same
issue. It solved the inheritence_column issue.

Thanks
-- 
Posted via http://www.ruby-forum.com/.
-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.


Reply via email to