Hi All I just noticed that I have a module that should never ever change the database. During unit testing I noticed it was possible. To solve this (for my tests) I added to my module: def save end I don''t know if this is good enough or maybe there is a better way ?! Thnx LuCa -- 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
The best way to do this is to set the scope of find to be :readonly (Not sure the syntax - anyone?) Luca Scaljery wrote:> Hi All > > I just noticed that I have a module that should never ever change the > database. During unit testing I noticed it was possible. To solve this > (for my tests) I added to my module: > def save > end > > I don''t know if this is good enough or maybe there is a better way ?! > > Thnx > LuCa > > -- > 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 rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---