Skip to content
Browse files

Fixing the attributes hash again for Ferret Adapter.

  • Loading branch information...
1 parent ded576a commit 98108f694bedc3e65b38295fa671db923d7e3155 @bernerdschaefer bernerdschaefer committed Sep 26, 2008
Showing with 5 additions and 1 deletion.
  1. +5 −1 adapters/dm-ferret-adapter/lib/ferret_adapter.rb
View
6 adapters/dm-ferret-adapter/lib/ferret_adapter.rb
@@ -22,7 +22,11 @@ def initialize(name, uri_or_options)
def create(resources)
resources.each do |resource|
- attributes = repository(@name) { resource.class.new(resource.attributes).attributes }
+ attributes = repository(self.name) do
+ attrs = resource.attributes
+ attrs.delete_if { |name, value| !resource.class.properties(self.name).has_property?(name) }
+ resource.class.new(attrs).attributes
+ end
attributes.merge!(:_type => resource.class.name)
@index.add attributes
end

0 comments on commit 98108f6

Please sign in to comment.
Something went wrong with that request. Please try again.