session_helper.rb 878 B

1234567891011121314151617181920212223242526272829303132
  1. module SessionHelper
  2. def self.default_collections(user)
  3. # auto population collections, store all here
  4. default_collection = {}
  5. # load collections to deliver from external files
  6. dir = File.expand_path('../../', __FILE__)
  7. files = Dir.glob( "#{dir}/app/controllers/sessions/collection_*.rb" )
  8. for file in files
  9. load file
  10. ExtraCollection.session( default_collection, user )
  11. end
  12. return default_collection
  13. end
  14. def self.push_collections(user)
  15. # auto population collections, store all here
  16. push_collections = {}
  17. # load collections to deliver from external files
  18. dir = File.expand_path('../../', __FILE__)
  19. files = Dir.glob( "#{dir}/app/controllers/sessions/collection_*.rb" )
  20. for file in files
  21. load file
  22. ExtraCollection.push( push_collections, user )
  23. end
  24. return push_collections
  25. end
  26. end