Sha256: 3629bbdd9e5aceaeb65a5fef3bf3ad008cd2af04f827b869e801ca7324c94bdc

Contents?: true

Size: 366 Bytes

Versions: 8

Compression:

Stored size: 366 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

8 entries across 8 versions & 1 rubygems

Version Path
mongo3-0.1.5 lib/helpers/database_helper.rb
mongo3-0.1.4 lib/helpers/database_helper.rb
mongo3-0.1.3 lib/helpers/database_helper.rb
mongo3-0.1.2 lib/helpers/database_helper.rb
mongo3-0.1.1 lib/helpers/database_helper.rb
mongo3-0.1.0 lib/helpers/database_helper.rb
mongo3-0.0.9 lib/helpers/database_helper.rb
mongo3-0.0.8 lib/helpers/database_helper.rb