Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/67.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/jpa/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails rails activerecord sqlserver适配器-(对象不支持检查)_Ruby On Rails_Sql Server_Activerecord - Fatal编程技术网

Ruby on rails rails activerecord sqlserver适配器-(对象不支持检查)

Ruby on rails rails activerecord sqlserver适配器-(对象不支持检查),ruby-on-rails,sql-server,activerecord,Ruby On Rails,Sql Server,Activerecord,我有一个应用程序正在经历从MySQL到MSSQL的转换。我们使用的是rails 3.2.22和activerecord sqlserver适配器3.2.16 在rails控制台中运行以下操作时: irb(main):008:0* f = F5Device.first F5Device Load (6.1ms) EXEC sp_executesql N'SELECT TOP (1) [dbo].[f5_devices].* FROM [dbo].[f5_devices]' => #&l

我有一个应用程序正在经历从MySQL到MSSQL的转换。我们使用的是rails 3.2.22和activerecord sqlserver适配器3.2.16

在rails控制台中运行以下操作时:

irb(main):008:0* f = F5Device.first
  F5Device Load (6.1ms)  EXEC sp_executesql N'SELECT TOP (1) [dbo].[f5_devices].* FROM [dbo].[f5_devices]'
=> #<F5Device id: 5422, name: "VMIKSA69901MEM", environment: "UAT", feed_type_id: 1, scm_device_id: 121764, created_at: "2012-08-24 01:02:52", updated_at: "2017-01-19 16:08:08", gonefishing: 0>
irb(main):009:0> f.members
(Object doesn't support #inspect)
=>

我以前也遇到过几次
(对象不支持#inspect)
错误。结果应该仍然有效,但您只需在其处于的状态下将其打印到屏幕上即可。尝试调用
f.members.first.to_s
并查看结果。@MichaelGorman我仍然收到
NoMethodError:undefined method
zero?:+:Symbol`
class F5Device < F5Base
      has_many :nodes, :class_name => "F5Node", :foreign_key => "device_id"
      has_many :members, :through => :nodes
      has_many :group_items , :foreign_key => :device_id
      has_many :groups, :through => :group_items
      has_many :dependencies, :class_name => "Dependency", :foreign_key => :device_id
      has_many :device_applications, :class_name => "F5DeviceApplication", :foreign_key => :device_id
      has_many :applications, :through => :device_applications
      has_many :websphere_servers, :class_name => "IisDependency", :foreign_key => :f5_device_id

    def pools
         members = self.members
         pools = []
         members.each do |m|
           pools << m.pool
         end
         pools
    end

class F5Node < F5Base
      has_many :bigips, :class_name => "F5Bigip", :foreign_key => :group_id, :primary_key => :group_id
      belongs_to :device, :class_name => "F5Device", :foreign_key => :device_id
      has_many :members, :class_name => "F5Member", :foreign_key => "node_id", :dependent => :destroy
      has_many :pools, :through => :members
      attr_accessor :ws, :bigip, :session_status, :monitor_status, :enabled_status, :status_description, :availability_status, :state
      after_initialize :set_ws


class F5Member < F5Base
      belongs_to :pool, :class_name => "F5Pool", :foreign_key => "pool_id"
      belongs_to :node, :class_name => "F5Node", :foreign_key => "node_id"
      has_one :websphere, :class_name => "IisDependency", :foreign_key => "f5_member_id"
      attr_accessor :ws, :bigip, :session_state, :session_status, :monitor_status, :statistics,:state