Good Day,
I have been using the book of Agile Web Development with Ruby on Rails 4 and I have been trying to use a Model Module in the directory: app/models/concerns/MyModule.rb
I found some documentation on how to do it for previous versions of rails using the /lib folder and some other methods but I need a simple method to call my Module inside my Model.
Module MyModule
extends ...
#
def some_method_in_MyModule
end
end
I have tried this:
app/models/users.eb
Class ...
include MyModule
a = some_method_in_MyModule
#
end
but rails keeps saying it is not correct.
How do I include a module method in a model with ruby on rails 4?