Where is the method that selects users from an external source put on the rails?

I have an ActiveRecord participant model, and I want to create a method that will extract elements from an external source and synchronize them with the members in the database already.

I do not know where I should put this method, which will be called. It seems like I should not put it in the controller, since that is a lot of logic, but I don’t know if I can add it to the model, since this seems to work only with the string.

Any advice would be appreciated, I'm new to RoR

+3
source share
2 answers

, , : def self.get_externals. Member.get_externals, , , , .

0

, lib.

, .

0

Source: https://habr.com/ru/post/1719183/


All Articles