Hello!
What I want is to create a Model that connects with another using a has_many association in a dynamic way, without the foreign key like this:
has_many :faixas_aliquotas, :class_name => 'Fiscal::FaixaAliquota',
:conditions => ["regra_fiscal = ?", ( lambda { return self.regra_fiscal } ) ]
But I get the error:
: SELECT * FROM "fis_faixa_aliquota" WHERE ("fis_faixa_aliquota".situacao_fiscal_id = 1
AND (regra_fiscal = E'--- !ruby/object:Proc {}'))
Is this possible?