#54 ✓resolved
Locv39KnvwDeXGpKpisHDaKw

Can't seem to disable magic states in production

Reported by Locv39KnvwDeXGpKpisHDaKw | March 13th, 2009 @ 06:54 PM

Having a hell of a time disabling magic states in production. Got it working in development.

I tried putting this in the UserSession model:


disable_magic_states true

I also tried putting this both in an initializer of its own as well as at the end of environment.rb.


UserSession.configure do |config|
  config.disable_magic_states = true
end

Any ideas what I might be doing wrong? This is with Rails 2.2, Authlogic 1.4.3.

Comments and changes to this ticket

  • Ben Johnson

    Ben Johnson March 13th, 2009 @ 07:14 PM

    • State changed from “new” to “open”

    Sounds like a caching issue. Are other config options working?

  • Locv39KnvwDeXGpKpisHDaKw

    Locv39KnvwDeXGpKpisHDaKw March 13th, 2009 @ 08:48 PM

    I think the other configs are working. Just using config.gem, config.action_controller.session, and config.action_controller.session_store.

    These were my cache settings in production.rb:

    
    config.cache_classes = false
    config.action_controller.perform_caching = false
    
  • Ben Johnson

    Ben Johnson March 23rd, 2009 @ 03:19 AM

    Try updating and see if this fixes the issue. I released a new version today.

  • Locv39KnvwDeXGpKpisHDaKw

    Locv39KnvwDeXGpKpisHDaKw March 25th, 2009 @ 02:50 PM

    Thanks. Before the new version was released, I ended up removing the problem column from my User model. With the new version, I added

    
    remove_acts_as_authentic_module(Authlogic::ActsAsAuthentic::MagicColumns)
    

    I'll let you know if I find any problems in production but I'm sure it'll be fine.

  • Ben Johnson

    Ben Johnson March 25th, 2009 @ 02:53 PM

    Well you should be able to just set disable_magic_states to true, look at Authlogic::Session::MagicStates. It is impossible for magic states to be validated if it is false.

  • Locv39KnvwDeXGpKpisHDaKw

    Locv39KnvwDeXGpKpisHDaKw March 25th, 2009 @ 03:03 PM

    Wouldn't it be better for me to just remove the module entirely though? It does the same thing and I assume it saves on memory, no? Or am I missing something?

  • Ben Johnson

    Ben Johnson March 25th, 2009 @ 03:10 PM

    I guess it doesn't hurt, the problem is that the names of the modules are somewhat internal. There is no contract between me and you that I won't change them. Where as the configuration option will stay there, and if it changes, I will at least give a deprecation notice or some kind of warning. But I doubt the name will change, and the memory you will save it probably not even noticeable.

  • Locv39KnvwDeXGpKpisHDaKw

    Locv39KnvwDeXGpKpisHDaKw March 25th, 2009 @ 04:11 PM

    Thanks, that makes sense and I guess the memory would be pretty negligible.

  • Ben Johnson

    Ben Johnson April 3rd, 2009 @ 01:20 AM

    • State changed from “open” to “resolved”
  • benone

    benone August 31st, 2009 @ 04:10 AM

    Hi Ben! Thanks for plugin!

    I have the same issue. disable_magic_states true works on dev and don't work on prod=(

  • pehivataxi

    pehivataxi May 30th, 2019 @ 07:16 AM

    Project of the light house is opened for the induction of the terms for the humans. The approval of the light house and assignment provider australia is done for the humans. The light house is engaged for the new investors of the field.

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

Object based authentication solution that handles all of the non sense for you. It's as easy as ActiveRecord is with a database.

People watching this ticket

Pages