[Rails] Microsoft SQL Server has me stumped

Emin Hasanov
Fri, 24 Mar 2006 22:15:59 -0000

Sorry, but what attributes are you expecting when creating brand new record
using InventoryItem.new?

On 3/25/06, Brian Hogan <bphogan@gmail.com> wrote:
>
> I''m tinkering around with an old legacy table in SQL Server 2000.
> Ruby 1.8.4, most recent ADO.rb file from RubyForge, Rails 1.0
>
>  Here''s the model:
>
> class InventoryItem < ActiveRecord::Base
>   set_table_name  "[_SMDBA_].[_INVENTOR_]"
>   set_primary_key  "sequence"
> end
>
> Everything works fine. I can retrieve records without issue.
>
> However, when create a new instance of InventoryItem, there are no
> attributes returned!
>
> i = InventoryItem.new
> #<InventoryItem:0x365eee0 @new_record=true, @attributes={}>
>
> Anyone know where I would start looking?
>
> Seems strange then that InventoryItem.find(:first) would return a full
> attribute set with all of the data appropriately assigned....
>
> Thanks in advance!
>
>
> _______________________________________________
> Rails mailing list
> Rails@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...