Skip to content

Commit

Permalink
Don't set callbacks in test environment
Browse files Browse the repository at this point in the history
  • Loading branch information
Fernando Blat Peris committed Aug 16, 2009
1 parent 6006b97 commit 6895258
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions config/initializers/filtered_collections.rb
@@ -1,6 +1,8 @@
Dir.glob(RAILS_ROOT + '/lib/collections/*.rb').each do |collection|
require collection
# Sets callbacks in models
collection_class = collection.split('/').last.split('.').first.camelize.constantize
collection_class.send(:set_callbacks)
# Sets callbacks in models except if test environment (not so elegant)
unless Rails.env.test?
collection_class = collection.split('/').last.split('.').first.camelize.constantize
collection_class.send(:set_callbacks)
end
end

0 comments on commit 6895258

Please sign in to comment.