Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix MONGOID-4865 include_root_in_json setting retrieval does not resp…
…ect hierarchy
- Loading branch information
Showing
4 changed files
with
150 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
module Helpers | ||
# Reloads the specified model class. | ||
# | ||
# @param [ String | Symbol ] name Class name to reload. | ||
def reload_model(name) | ||
Object.class_eval do | ||
remove_const(name) | ||
end | ||
load "spec/app/models/#{name.to_s.underscore}.rb" | ||
end | ||
end |