Skip to content

Instantly share code, notes, and snippets.

@cheald
Created February 5, 2014 23:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cheald/8835643 to your computer and use it in GitHub Desktop.
Save cheald/8835643 to your computer and use it in GitHub Desktop.
module MongoMapper
module Plugins
module Sci
module ClassMethods
def inherited(subclass)
super
if @collection_name == subclass.instance_variable_get("@collection_name")
key :_type, String unless key?(:_type)
subclass.single_collection_parent = self
subclass.instance_variable_set("@single_collection_inherited", true)
end
end
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment