I'm begining whith rails. In the rails directory structure, where is the nicest directory tu put my active record callback objects ? app/helpers ? app/models ? lib ?
May looks a stupid questions but i can't find answers googling.
I'm begining whith rails. In the rails directory structure, where is the nicest directory tu put my active record callback objects ? app/helpers ? app/models ? lib ?
May looks a stupid questions but i can't find answers googling.
I put my observer classes in app/models.
jeremy
I keep my observers in app/observers. Feels cleaner to me.
For it to work, add that directory to load path in environment.rb:
config.load_paths << "#{RAILS_ROOT}/app/observers"
Thanks for your replies. I undestand that there is not a rails defined directory to put the callbacks/observers objects. As my callback only depends on the model stack, i put it in a new directory : app/models/callbacks. Works fine and seems nice for me.