1
I would like to create an object with the fields equal to the query of Activerecord, however, with the fields pre-filled or blank, so that they are called in the same way in the other file...
To illustrate better, the code snippet that I
      def organization_name_for_emails(organization = @organization)
        @organization_name_for_emails ||= organization.emails.first
        if @organization_name_for_emails == "" || @organization_name_for_emails.blank?
          #CRIAR O OBJETO
          return @organization_name_for_emails = "RETORNO QUE EU 
QUISER DAR DA TABELA, NESTE CASO GOSTARIA DE DAR UM VALOR 
chamado "Nome" para o campo "name" da tabela que irá receber no outro arquivo."
        else
          return @organization_name_for_emails
        end
      end
In this case it would have to work on this code snippet,
  def confirm_email(event, participant)
    @event = event
    @organization = event.owner_organization
    @participant = participant
    **@organization_name_for_emails = organization_name_for_emails(@organization)
    subject = I18n.t("views.mailer.event_registration.confirm_email.subject", :name_subject => @organization_name_for_emails.name)**
    destination = AppConfig[:send_emails] ? @participant.email : AppConfig["default_email"]
    mail(:to => destination, :subject => subject)
  end
Has anyone ever gone through this, has a better solution or some hint?
Thank you!
I couldn’t understand very well what you want. =\
– Luiz Carvalho
So I solved the problem differently...
– Andre Leoni