Beginner question about ActiveRecord

Hi, I’m an experienced Java programmer but have started coding ror in
the last month.

I have a lot of doubts now and hope I can get some help so I can be the
one to help others in the future :slight_smile:

So, I’m beggining to develop my first rails application, and installed a
gem called brazilian-rails (https://github.com/tapajos/brazilian-rails)
so I can add some validations to my app.

After installing this gem, I have implemented this class

class Tenista < ActiveRecord::Base
validates_presence_of :nome, :cpf

usar_como_cpf :cpf
end

My question is: where is this usar_como_cpf method coming from? How did
my class suddenly recognized it, since it only extends
ActiveRecord::Base?

Thanks,
Rafael

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs