lib/spree/auth/configuration.rb in spree_auth_devise-4.5.0 vs lib/spree/auth/configuration.rb in spree_auth_devise-4.6.0
- old
+ new
@@ -1,10 +1,33 @@
module Spree
module Auth
- class Configuration < Preferences::Configuration
- preference :registration_step, :boolean, default: true
- preference :signout_after_password_change, :boolean, default: true
- preference :confirmable, :boolean, default: false
- preference :validatable, :boolean, default: true
+ class Configuration
+ attr_accessor :registration_step,
+ :signout_after_password_change,
+ :confirmable,
+ :validatable
+
+ def initialize
+ self.registration_step = true
+ self.signout_after_password_change = true
+ self.confirmable = false
+ self.validatable = true
+ end
+
+ def configure
+ yield(self) if block_given?
+ end
+
+ def get(preference)
+ send(preference)
+ end
+
+ alias [] get
+
+ def set(preference, value)
+ send("#{preference}=", value)
+ end
+
+ alias []= set
end
end
end