lib/fiona7/table_switcher.rb in infopark_fiona7-1.1.0.0.8 vs lib/fiona7/table_switcher.rb in infopark_fiona7-1.1.0.0.9
- old
+ new
@@ -26,12 +26,14 @@
@quoted_table_name = nil
@arel_table = nil
@sequence_name = nil unless defined?(@explicit_sequence_name) && @explicit_sequence_name
@relation = ActiveRecord::Relation.create(self, arel_table)
- # reset associations, otherwise they go out of sync
- has_many :children, :class_name => klass_name, :foreign_key => 'parent_obj_id'
- belongs_to :parent, :class_name => klass_name, :foreign_key => 'parent_obj_id'
+ if self == Fiona7::WriteObj
+ # reset associations, otherwise they go out of sync
+ has_many :children, :class_name => 'RailsConnector::AbstractObj', :foreign_key => 'parent_obj_id'
+ belongs_to :parent, :class_name => 'RailsConnector::AbstractObj', :foreign_key => 'parent_obj_id'
+ end
end
end
end
end