Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@pjb3
Copy link
Contributor

@pjb3 pjb3 commented Jan 6, 2015

Resolves issue #4

@ankane
Copy link
Owner

ankane commented Jan 8, 2015

Hey Paul, thanks for the pull request! How about:

Blazer.user_class_name = 'Admin'

to keep it consistent with the other customizations?

@pjb3
Copy link
Contributor Author

pjb3 commented Jan 8, 2015

@ankane I wanted to do that too initially but I don't think that works because you have to reference the value when you define the associations and you won't have a chance to set that value in an initializer before the models in blazer are loaded.

@paultyng
Copy link
Contributor

Spree does it via an initializer and referencing the variable in its associations, so I think that works.

Spree::Order model: https://github.com/spree/spree/blob/master/core/app/models/spree/order.rb#L38

@ankane
Copy link
Owner

ankane commented Jan 15, 2015

@pjb3 does #6 work for you?

@pjb3
Copy link
Contributor Author

pjb3 commented Jan 28, 2015

@ankane Yes, @paultyng's solution works fine, I didn't realize the Rails models get loaded after the initializers run

@ankane
Copy link
Owner

ankane commented Jan 31, 2015

Thanks @pjb3, just merged #6.

@ankane ankane closed this Jan 31, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants