lib/controlled_versioning/revision/publisher.rb in controlled_versioning-0.8.0 vs lib/controlled_versioning/revision/publisher.rb in controlled_versioning-0.9.0
- old
+ new
@@ -19,11 +19,11 @@
def new_attributes
version_attributes.each_with_object({}) {|v, h| h[v.name] = v.new_value }
end
def create_versionable
- version.versionable = version.versionable_type.constantize.
- create(new_attributes)
+ version.versionable = version.parent.versionable.public_send(
+ version.association_name).create(new_attributes)
end
def update_versionable
versionable.update_attributes(new_attributes)
end
\ No newline at end of file