Hi all,

i have a method that I use in the 'after_save' that is implemented as
follows:


 def verify
    a =11674
    x =  self.aui_codigo


      reinc =AutoInfracao.find_by_sql("select age((select aui_data_lav
from tb_aui_auto_infracao where aui_codigo=#{a}),
(select max(aui_data_lav)from tb_aui_auto_infracao where aui_codigo
in(select a.aui_codigo from tb_aur_auto_inf_regular a,tb_iau_itens_auto
i where a.for_cod =(select for_cod from tb_aur_auto_inf_regular where
aui_codigo=#{a}) and a.lir_codigo=(select lir_codigo from
tb_aur_auto_inf_regular where aui_codigo = #{a}) and i.inf_codigo =
(select inf_codigo from tb_iau_itens_auto where aui_codigo = #{a}) and
a.aui_codigo<>#{a} and a.aui_codigo = i.aui_codigo)))")

    print reinc[0].age
  end

the 'a' and the 'x' variables have the same value(11674) and the same
type(FixNum).Curiously,I can run my query using the 'a' variable,but I
cannot run it using the 'x' variable.What am I doing wrong?
-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to