Skip to content

Commit

Permalink
consistent method order
Browse files Browse the repository at this point in the history
  • Loading branch information
subvertallchris committed Jan 29, 2015
1 parent 8e3cb72 commit f89b200
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions lib/neo4j/active_node/query/query_proxy_methods.rb
Expand Up @@ -125,18 +125,18 @@ def optional(association, node_id = nil)
end

def includes(association_name, given_child_id = nil, given_rel_id = nil)
prepopulate(false, association_name, given_rel_id, given_child_id)
prepopulate(false, association_name, given_child_id, given_rel_id)
end

def includes_filtered(association_name, given_child_id = nil, given_rel_id = nil)
prepopulate(true, association_name, given_rel_id, given_child_id)
prepopulate(true, association_name, given_child_id, given_rel_id)
end

protected

def prepopulate(filtered, association_name, rel_id, child_id)
def prepopulate(filtered, association_name, child_id, rel_id)
preloader_class = filtered ? Neo4j::ActiveNode::Query::QueryProxyFilteredPreloader : Neo4j::ActiveNode::Query::QueryProxyPreloader
preloader_class.new(self, child_id).tap { |p| p.initial_queue(association_name, rel_id, child_id) }
preloader_class.new(self, child_id).tap { |p| p.initial_queue(association_name, child_id, rel_id) }
end

private
Expand Down
2 changes: 1 addition & 1 deletion lib/neo4j/active_node/query/query_proxy_preloader.rb
Expand Up @@ -12,7 +12,7 @@ def initialize(query_proxy, child_id)
@queued_methods = {}
end

def initial_queue(association_name, rel_id, given_child_id)
def initial_queue(association_name, given_child_id, rel_id)
@child_id = given_child_id || :"#{target_id}_child"
@caller = caller.query.proxy_as_optional(caller.model, target_id).send(association_name, child_id, rel_id)
caller.instance_variable_set(:@preloader, self)
Expand Down

0 comments on commit f89b200

Please sign in to comment.