Skip to content

Commit

Permalink
Indention.
Browse files Browse the repository at this point in the history
  • Loading branch information
jnunemaker committed Aug 28, 2009
1 parent ce38c83 commit 048c898
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions lib/mongomapper/associations/many_documents_as_proxy.rb
Expand Up @@ -2,26 +2,26 @@ module MongoMapper
module Associations
class ManyDocumentsAsProxy < ManyDocumentsProxy
protected
def scoped_conditions
{as_type_name => @owner.class.name, as_id_name => @owner.id}
end
def scoped_conditions
{as_type_name => @owner.class.name, as_id_name => @owner.id}
end

def apply_scope(doc)
ensure_owner_saved
def apply_scope(doc)
ensure_owner_saved

doc.send("#{as_type_name}=", @owner.class.name)
doc.send("#{as_id_name}=", @owner.id)
doc.send("#{as_type_name}=", @owner.class.name)
doc.send("#{as_id_name}=", @owner.id)

doc
end
doc
end

def as_type_name
@as_type_name ||= @association.options[:as].to_s + "_type"
end
def as_type_name
@as_type_name ||= @association.options[:as].to_s + "_type"
end

def as_id_name
@as_id_name ||= @association.options[:as].to_s + "_id"
end
def as_id_name
@as_id_name ||= @association.options[:as].to_s + "_id"
end
end
end
end

0 comments on commit 048c898

Please sign in to comment.