Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Rails.application.eager_load!
- ObjectSpace.each_object(Class) do |cls|
- if cls.ancestors[1..-1].include?(ActiveRecord::Base)
- begin
- cls.instance_eval do
- default_scope { order('rand()') }
- end
- rescue
- warn "Can't fix #{cls}"
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement