0

I'm using devise v.2.2.4 on my Rails 3.2.17 and I need some features related with security policies.

The admin user will change the security policies at any time like show next image: enter image description here

but I don't know how make it with devise, because devise read configuration of initializers/devise.rb and on production all initializer are loading the first time only.

enrique-carbonell
  • 5,836
  • 3
  • 30
  • 44

1 Answers1

0

I believe you can pre-seed some table with default preferences data for devise (or any other gem/library) and then get it from the db in your initializer. Then add some crud to let admin user change this preferences. But full restart of app will be needed for update this preferences.

ryaz
  • 316
  • 1
  • 8
  • 1
    thks @ryaz, but I have interest to make it without app restart for update this preferences. – enrique-carbonell Nov 14 '14 at 20:05
  • @aboltart I think that might be helpful for you guys - http://stackoverflow.com/questions/5614740/dynamic-validation-and-metaprogramming-in-ruby Since devise runs rails validations you can basically decide which validations you wanna run. – ryaz Oct 10 '16 at 19:26