Sha256: 0e01fc1842a53e966e15a69434596d9fb5fb122a7ac90e4f5986718afb5c8fa0

Contents?: true

Size: 475 Bytes

Versions: 12

Compression:

Stored size: 475 Bytes

Contents

module Draper
  module ViewContext
    def self.current
      Thread.current[:current_view_context]
    end

    def self.current=(input)
      Thread.current[:current_view_context] = input
    end
  end

  module ViewContextFilter
    def set_current_view_context
      Draper::ViewContext.current = self.view_context
    end

    def self.included(source)
      source.send(:before_filter, :set_current_view_context) if source.respond_to?(:before_filter)
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
draper-0.15.0 lib/draper/view_context.rb
draper-0.15.0rc1 lib/draper/view_context.rb
draper-0.14.0 lib/draper/view_context.rb
draper-0.12.3 lib/draper/view_context.rb
draper-0.12.2 lib/draper/view_context.rb
draper-0.13.0 lib/draper/view_context.rb
draper-0.12.1 lib/draper/view_context.rb
draper-0.12.0 lib/draper/view_context.rb
draper-0.11.1 lib/draper/view_context.rb
draper-0.11.0 lib/draper/view_context.rb
draper-0.10.0 lib/draper/view_context.rb
draper-0.9.5 lib/draper/view_context.rb