This is a private method in some Ruby code that...
This is a private method in some Ruby code that takes in two arguments, organization_id
and mod_organization_id
. It first looks up an access token for the current user by calling AccessToken.find_by_resource_owner(current_user)
.
Then, it tries to find an organization with the given organization_id
by calling Organization.find_by(id: organization_id)
using Active Record. If it finds the organization, it returns it.
If it doesn't find the organization, it instantiates a new object of the Mod::Api::Wrapper::FindOrImportOrganization
class and passes in the access token and mod_organization_id
as arguments. Then, it calls .perform
on this object to try to locate or import the organization. This method call will return the found or imported organization.
Overall, this method is trying to retrieve an organization with the given ID, either from the database or by importing it through a third-party API wrapper.