SessionAttributes

A modified ActiveSupport::CurrentAttributes designed to persist across sessions. Useful for creating fancy singletons for storing session attributes

For more documentation, visit the ActiveSupport::CurrentAttributes docs here

Usage

Create a class inheriting from SessionAttributes in app/models:

class Journey < SessionAttributes
  attribute :explorer, :basecamp
end

Then utilize it in your controllers:

Journey.explorer = Member.find(params[:username])
Journey.explorer.update!(name: "SessionAttributes Demo")
Journey.reset

Installation

Add this line to your application's Gemfile:

gem "session_attributes"

And then execute:

$ bundle

Or install it yourself as:

$ gem install session_attributes

Contributing

Contribution directions go here.

License

The gem is available as open source under the terms of the MIT License.