Sha256: c41754a26f35a8de726eafd5a42740d165e2b15ec8b89a4dcdf6fc80a1083c6d

Contents?: true

Size: 624 Bytes

Versions: 30

Compression:

Stored size: 624 Bytes

Contents

module Footnotes
  module Notes
    class SessionNote < AbstractNote
      def initialize(controller)
        session = controller.session
        if session
          if session.respond_to? :to_hash
            # rails >= 2.3
            session = session.to_hash
          else
            #rails < 2.3
            session = session.data
          end
        end
        @session = (session || {}).symbolize_keys
      end

      def title
        "Session (#{@session.length})"
      end

      def content
        mount_table_for_hash(@session, :summary => "Debug information for #{title}")
      end
    end
  end
end

Version data entries

30 entries across 30 versions & 2 rubygems

Version Path
rails-footnotes-7.1.0 lib/rails-footnotes/notes/session_note.rb
rails-footnotes-7.0.1 lib/rails-footnotes/notes/session_note.rb
rails-footnotes-7.0.0 lib/rails-footnotes/notes/session_note.rb
rails-footnotes-5.0.0 lib/rails-footnotes/notes/session_note.rb
rails6-footnotes-5.0.2 lib/rails-footnotes/notes/session_note.rb
rails6-footnotes-5.0.1 lib/rails-footnotes/notes/session_note.rb
rails6-footnotes-5.0.0 lib/rails-footnotes/notes/session_note.rb
rails-footnotes-4.1.8 lib/rails-footnotes/notes/session_note.rb
rails-footnotes-4.1.7 lib/rails-footnotes/notes/session_note.rb
rails-footnotes-4.1.6 lib/rails-footnotes/notes/session_note.rb
rails-footnotes-4.1.5 lib/rails-footnotes/notes/session_note.rb
rails-footnotes-4.1.4 lib/rails-footnotes/notes/session_note.rb
rails-footnotes-4.1.3 lib/rails-footnotes/notes/session_note.rb
rails-footnotes-4.1.2 lib/rails-footnotes/notes/session_note.rb
rails-footnotes-4.1.1 lib/rails-footnotes/notes/session_note.rb
rails-footnotes-4.1.0 lib/rails-footnotes/notes/session_note.rb
rails-footnotes-4.0.2 lib/rails-footnotes/notes/session_note.rb
rails-footnotes-4.0.1 lib/rails-footnotes/notes/session_note.rb
rails-footnotes-4.0.0 lib/rails-footnotes/notes/session_note.rb
rails-footnotes-3.7.9 lib/rails-footnotes/notes/session_note.rb