No commit activity in last 3 years
No release in over 3 years
Per-request registry
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.13
~> 10.0
~> 3.0

Runtime

 Project Readme

RequestRegistry

1. Create registry

class AppRegistry
  extend RequestRegistry.new(:user, :account)
end

2. Use it anywhere

Set it in controller

class ApplicationController < ActionController::Base
  before_action :provide_registry_information

  private

  def provide_registry_information
    AppRegistry.user = current_user
    AppRegistry.account = 'my awesome account'
  end
end

And get it in model

class Post < ActionController::Base
  belongs_to :author
  before_save :set_author

  private

  def set_author
    self.author = AppRegistry.user.presence
  end
end