Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Silence deprecation warning from the rename of Module#parent to Module#module_parent #345

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion lib/rails_erd/domain.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,13 @@ def initialize(models = [], options = {})
# Returns the domain model name, which is the name of your Rails
# application or +nil+ outside of Rails.
def name
defined? Rails and Rails.application and Rails.application.class.parent.name
return unless defined?(Rails) && Rails.application

if Rails.application.class.respond_to?(:module_parent)
Rails.application.class.module_parent.name
else
Rails.application.class.parent.name
end
end

# Returns all entities of your domain model.
Expand Down