Module: UserTimezone::DetectsTimezone::ClassMethods
- Defined in:
- lib/user_timezone/detects_timezone.rb
Instance Method Summary collapse
Instance Method Details
#detects_timezone(options = {}) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/user_timezone/detects_timezone.rb', line 8 def detects_timezone( = {}) cattr_accessor :timezone_detector self.timezone_detector = UserTimezone::TimezoneDetector.new() include LocalInstanceMethods case [:on] when :before_save before_save :detect_timezone! when :before_create before_create :detect_timezone! else # Do nothing, but using switch statement end end |