2012-10-23 19:12:00 +00:00
|
|
|
module SessionHelper
|
2012-10-23 20:25:42 +00:00
|
|
|
def self.default_collections(user)
|
2012-10-23 19:12:00 +00:00
|
|
|
|
|
|
|
# auto population collections, store all here
|
|
|
|
default_collection = {}
|
|
|
|
|
|
|
|
# load collections to deliver from external files
|
|
|
|
dir = File.expand_path('../../', __FILE__)
|
|
|
|
files = Dir.glob( "#{dir}/app/controllers/sessions/collection_*.rb" )
|
|
|
|
for file in files
|
|
|
|
load file
|
2012-10-23 20:25:42 +00:00
|
|
|
ExtraCollection.session( default_collection, user )
|
2012-10-23 19:12:00 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
return default_collection
|
|
|
|
end
|
2012-10-23 20:25:42 +00:00
|
|
|
def self.push_collections(user)
|
2012-10-23 19:12:00 +00:00
|
|
|
|
|
|
|
# auto population collections, store all here
|
|
|
|
push_collections = {}
|
|
|
|
|
|
|
|
# load collections to deliver from external files
|
|
|
|
dir = File.expand_path('../../', __FILE__)
|
|
|
|
files = Dir.glob( "#{dir}/app/controllers/sessions/collection_*.rb" )
|
|
|
|
for file in files
|
|
|
|
load file
|
2012-10-23 20:25:42 +00:00
|
|
|
ExtraCollection.push( push_collections, user )
|
2012-10-23 19:12:00 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
return push_collections
|
|
|
|
end
|
|
|
|
end
|