I
I
Ivan Nesterovich2014-06-09 18:40:17
Ruby on Rails
Ivan Nesterovich, 2014-06-09 18:40:17

[Rails] How to access model if such module exists?

I created a Color model, but when creating a record, I get an error:

NoMethodError: undefined method `create!' for Color:Module

Then I found that one of the gems connects another gem https://github.com/halostatue/color/blob/master/li... , which defines the Color module.
How can I access my model in this case?
Update:
::Color doesn't fix the problem.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
Dimitriy, 2014-06-09
@vanderv

gem 'color', require: false

M
Marat Amerov, 2014-06-09
@amerov

::Color.create!

D
DeepHill, 2014-06-09
@DeepHill

Class and Module with the same name - how to choos...
::Color.create!

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question