Module: TZTime::ActiveRecord::Acts::LocalTime::InstanceMethods

Defined in:
lib/tztime/activerecord/acts/local_time.rb

Overview

:nodoc:

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(into) ⇒ Object



93
94
95
# File 'lib/tztime/activerecord/acts/local_time.rb', line 93

def self.included(into)
	into.alias_method_chain :method_missing, :local_time
end

Instance Method Details

#method_missing_with_local_time(name, *args, &block) ⇒ Object



97
98
99
100
101
102
103
104
105
106
107
# File 'lib/tztime/activerecord/acts/local_time.rb', line 97

def method_missing_with_local_time(name, *args, &block)
	ns = name.to_s
	if ns =~ /local_(.+)/ && 
	  value = send!($1, *args, &block)
	  if value.is_a?(Time) || value.is_a?(DateTime)
	    builder = send!(acts_as_local_time_options[:time_builder_accessor])
	    return builder.at_utc(value)
	  end
	end
	method_missing_without_local_time(name, *args, &block)
end