You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 30, 2021. It is now read-only.
Without paranoid: The above code works fine if i remove acts_as_paranoid from user model.
WIth paranoid: It saves only the parent record(Message) but fails to save the child record(MessageRecipient) in rails 3.2.13.But the same code works fine with rails 3.2.12. It seems to be a wierd behaviour.
The text was updated successfully, but these errors were encountered:
This is my scenario.
class Message < ActiveRecord::Base
belongs_to :user, :foreign_key => "from_user_id"
has_many :message_recipients, :include => [:user], :dependent => :destroy
has_many :recipients, :through => :message_recipients, :source => :user
end
class MessageRecipient < ActiveRecord::Base
belongs_to :user
belongs_to :message, :include => :message_recipients
end
class User < ActiveRecord::Base
acts_as_paranoid
has_many :message_recipients
end
@test=Message.new
@test.name="Test";
@test.recipients.push(User.find(1))
@test.save
Without paranoid: The above code works fine if i remove acts_as_paranoid from user model.
WIth paranoid: It saves only the parent record(Message) but fails to save the child record(MessageRecipient) in rails 3.2.13.But the same code works fine with rails 3.2.12. It seems to be a wierd behaviour.
The text was updated successfully, but these errors were encountered: