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

Already on GitHub? Sign in to your account

Fixes a bug in the name... not sure if this breaks something elsewhere! #6

wants to merge 1 commit into


None yet
2 participants

maxsum-corin commented May 17, 2011


I was trying to add a relationship on a session to a user. i.e.

require 'dm-rails/session_store'
class Session < Rails::DataMapper::SessionStore::Session
  belongs_to :user, :required => false

require 'dm-rails/session_store'
Rails::DataMapper::SessionStore.session_class = Session
My::Application.config.session_store Rails::DataMapper::SessionStore

But I kept hitting this error: Cannot find the parent_model User for session in user

This patch fixes my problem. I'm not sure if this has any unintended side-effects... not sure why self.name is overwritten in the first place. Case matters when DataMapper::Ext::Module.find_const comes to find the Model class for the belongs_to relationship; not sure if any other code relies on lower case.

Please let me know if I'm going about this the wrong way.



tpitale commented Feb 14, 2016

I'll take a look, thanks @maxsum-corin.

@tpitale tpitale added this to the 1.3.0 milestone Feb 14, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment