Skip to content

Commit

Permalink
pullreview adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
subvertallchris committed Sep 8, 2014
1 parent d7c2b2a commit c202aac
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
3 changes: 1 addition & 2 deletions lib/neo4j/active_rel/property.rb
Expand Up @@ -6,7 +6,7 @@ module Property
%w[to_node from_node].each do |direction|
define_method("#{direction}") { instance_variable_get("@#{direction}") }
define_method("#{direction}=") do |argument|
raise FrozenRelError, "Relationship start/end nodes cannot be changed once persisted" if self.persisted?
raise FrozenRelError, 'Relationship start/end nodes cannot be changed once persisted' if self.persisted?
instance_variable_set("@#{direction}", argument)
end
end
Expand All @@ -26,7 +26,6 @@ def initialize(attributes = {}, options = {})
end

module ClassMethods

# Extracts keys from attributes hash which are relationships of the model
# TODO: Validate separately that relationships are getting the right values? Perhaps also store the values and persist relationships on save?
def extract_association_attributes!(attributes)
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/active_rel/persistence_spec.rb
Expand Up @@ -130,7 +130,7 @@ def any_stubs_and_expectations
expect(that_class_node).not_to receive(:class)
clazz.any_instance.stub(:_create_rel)
clazz.any_instance.stub(:init_on_load)
expect{r.save}.not_to raise_error
expect { r.save }.not_to raise_error
end

it 'does not check the classes of the nodes' do
Expand Down
6 changes: 3 additions & 3 deletions spec/unit/active_rel/property_spec.rb
Expand Up @@ -61,9 +61,9 @@
describe 'class methods' do
describe 'extract_relationship_attributes!' do
it 'returns the from and to keys and values' do
expect(clazz.extract_association_attributes!({to_node: 'test', from_node: 'test', name: 'chris'})).to eq(to_node: 'test', from_node: 'test')
expect(clazz.extract_association_attributes!({to_node: 'test', name: 'chris'})).to eq(to_node: 'test')
expect(clazz.extract_association_attributes!({from_node: 'test', name: 'chris'})).to eq(from_node: 'test')
expect(clazz.extract_association_attributes!({ to_node: 'test', from_node: 'test', name: 'chris' })).to eq(to_node: 'test', from_node: 'test')
expect(clazz.extract_association_attributes!({ to_node: 'test', name: 'chris' })).to eq(to_node: 'test')
expect(clazz.extract_association_attributes!({ from_node: 'test', name: 'chris' })).to eq(from_node: 'test')
end
end

Expand Down

0 comments on commit c202aac

Please sign in to comment.