Sha256: cbe44eacddfbbb70f9d825aba93348cf423f2c7955aa31596631943d38481d4a

Contents?: true

Size: 337 Bytes

Versions: 3

Compression:

Stored size: 337 Bytes

Contents

module DatabaseHelper
  helpers do
      
    def db_title
      paths = session[:path_names].split( "|" )
      return context_for( paths ), paths.last
    end
   
    def context_for( paths )
      case paths.size
        when 2 : "zone"
        when 3 : "database"
        else     "collection"
      end      
    end    
  end  
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
mongo3-0.0.7 lib/helpers/database_helper.rb
mongo3-0.0.6 lib/helpers/database_helper.rb
mongo3-0.0.5 lib/helpers/database_helper.rb