
dm-is-remixable fires callbacks on the remixing model twice
Reported by --- | August 28th, 2008 @ 05:29 PM
module Comment
include DataMapper::Resource
is :remixable
property :id, Integer, :key => true, :serial => true
property :body, Text
property :created_at, DateTime
end
class Section
include DataMapper::Resource
after(:create) { puts 'prints me out twice' }
property :id, Serial
property :content, DM::Text
remix n, :comments, :as => 'comments'
end
Section.create(:content => 'Whatever') would fire after create callback twice.
Comments and changes to this ticket
-
--- August 28th, 2008 @ 05:29 PM
- Title changed from Fires callbacks on the remixing model twice to dm-is-remixable fires callbacks on the remixing model twice
-
coryodaniel September 9th, 2008 @ 08:26 PM
Look into your 'require's. I came across this when i was writing remixables, but it was actually because the same class was required twice, but with different relative paths. Since it was called twice, the 'after' and 'before' callbacks are all called twice.
-
Jonathan Stott (namelessjon) December 11th, 2008 @ 10:08 AM
- Assigned user cleared.
- State changed from new to resolved
I couldn't duplicate this, so I'm marking it as resolved
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
People watching this ticket
- Nobody is watching this ticket.