#Warning, the below is pseudo code, the conditionals are all that count for column in Class.content_columns column.type output: Time column.klass output: Time column.is_a?(Time) false column.type.is_a?(Time) false column.klass.is_a?(Time) false column.type.kind_of?(Time) false column.klass.kind_of?(Time) false column.type == Time false column.klass == Time *true* I know I''m missing something obvious...but that''s a lot of "type testing" and I can''t see for the life of me why column.klass == Time evaluates to true when column.klass.kind_of or is_a? evaluates to false --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
First, Object#type is deprecated (use Object#class) instead. AR overrides type to provied the active record type ie string, datetime etc... class gives you the actual class, on my machine I get something like ActiveRecord::ConnectionAdapters::MysqlColumn Secondly, assuming a.class == Time, why should a.class.kind_of?(Time) be true ? a.class is an instance of Class, not an instance of Time Fred -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---