app/models/ucb_rails/configuration/ldap.rb in ucb_rails-0.0.8 vs app/models/ucb_rails/configuration/ldap.rb in ucb_rails-0.0.9

- old
+ new

@@ -9,10 +9,11 @@ end def configure configure_host authenticate + test_entries end private def configure_host @@ -22,14 +23,22 @@ def authenticate if config.has_key?('username') UCB::LDAP.authenticate config['username'], config['password'] end end - + + def test_entries + UCB::LDAP::Person.include_test_entries = config.fetch('include_test_entries', default_include_test_entries) + end + def default_host RailsEnvironment.production? ? 'nds.berkeley.edu' : 'nds-test.berkeley.edu' end + def default_include_test_entries + RailsEnvironment.not_production? + end + class << self def configure(config) new(config).configure end end \ No newline at end of file