Ruby 奇怪的数据映射器问题

Ruby 奇怪的数据映射器问题,ruby,datamapper,ruby-datamapper,Ruby,Datamapper,Ruby Datamapper,我有一个关联模型,当我试图删除一条记录时,它返回true,但该记录仍然存在,该模型有两列,它们是键,而第三列是枚举,也是一个键。在DataMapper中更新/删除关联模型的任何提示 class A #some property definition end class B #some property definition end class C include DataMapper::Resource include DataMapper::Grape::Resourc

我有一个关联模型,当我试图删除一条记录时,它返回
true
,但该记录仍然存在,

该模型有两列,它们是
,而第三列是
枚举
,也是一个键。

在DataMapper中更新/删除关联模型的任何提示

class A
   #some property definition
end

class B
   #some property definition
end

class C
  include DataMapper::Resource
  include DataMapper::Grape::Resource

  expose :type

  property :type, Enum[:a, :b], :key => true, :unique => false

  belongs_to :a, :key => true
  belongs_to :b, :key => true

end
内部机架sh


你能写下表和所用查询之间的关系吗..试试这个:我遇到DataMapper::Immutable问题当我试图更新记录时,我经历了stackoverflow,但没有人回答我的问题,将发布关系soon@GhostRider我已经为模型添加了代码&我尝试了什么now@GhostRider我已经为模型添加了代码&到目前为止我都在尝试什么
element = C.get(:a,1,1)
# => returns Hash Object
# Fine till now
element.destroyed?
# => true
# I dont know why did it return true, I am 100% sure I havent performed destroy or destroy! on element
element.type
# => :a
element.type = :b
# => DataMapper::ImmutableError: Immutable resource cannot be modified
element.destroy!
# => true
C.get(:a,1,1)
# => the same Hash Object rather than returning nil