diff --git a/lib/fb_graph2/attribute_assigner.rb b/lib/fb_graph2/attribute_assigner.rb index 4e9604e..ce1dcfb 100644 --- a/lib/fb_graph2/attribute_assigner.rb +++ b/lib/fb_graph2/attribute_assigner.rb @@ -16,7 +16,6 @@ module FbGraph2 end def assign(attributes) - self.raw_attributes = attributes Array(self.class.registered_attributes).each do |type, keys| keys.each do |key| if attributes.include? key diff --git a/lib/fb_graph2/node.rb b/lib/fb_graph2/node.rb index 9b6bff5..d7fe680 100644 --- a/lib/fb_graph2/node.rb +++ b/lib/fb_graph2/node.rb @@ -9,6 +9,7 @@ module FbGraph2 def initialize(id, attributes = {}) self.id = id + self.raw_attributes = attributes assign attributes if respond_to? :assign authenticate attributes[:access_token] if attributes.include? :access_token end diff --git a/spec/fb_graph2/node_spec.rb b/spec/fb_graph2/node_spec.rb index 4a816cb..4aa5dcd 100644 --- a/spec/fb_graph2/node_spec.rb +++ b/spec/fb_graph2/node_spec.rb @@ -70,7 +70,7 @@ describe FbGraph2::Node do describe '#initialize' do its(:id) { should == 'identifier' } its(:access_token) { should be_nil } - its(:raw_attributes) { should be_nil } + its(:raw_attributes) { should == {} } end describe '#authenticate' do