Bill Walton
2007-Mar-02 05:07 UTC
Where''s the list of valid attributes / methods for column objects?
I''m trying to figure out what the valid attributes are on a column object. The Rails scaffolding generates a list view that uses column.column_name for example. ActiveRecord::Base#columns says it returns "an array of column objects for the table associated with this class". But I can''t find a list of the attributes of / methods on a column object anywhere. Any help would be very much appreciated. Thanks, Bill --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Andrew Stewart
2007-Mar-02 09:17 UTC
Re: Where''s the list of valid attributes / methods for column objects?
Hello, On 2 Mar 2007, at 05:07, Bill Walton wrote:> I''m trying to figure out what the valid attributes are on a column > object. > The Rails scaffolding generates a list view that uses > column.column_name for > example. ActiveRecord::Base#columns says it returns "an array of > column > objects for the table associated with this class". But I can''t > find a list > of the attributes of / methods on a column object anywhere.Try using script/console: Let''s say that you have a User model. >> User.columns.first.methods => ["to_a", "respond_to?", "returning", "daemonize", "type", "limit", "protected_methods", "human_name", "silence_stream", "eql?", "number?", "instance_variable_set", "precision", "is_a?", "taguri", "hash", "to_s", "send", "dclone", "remove_subclasses_of", "ri", "pretty_print_cycle", "primary", "default", "with_options", "taguri=", "silence_warnings", "pretty_print_inspect", "class", "tainted?", "private_methods", "primary=", "__send__", "to_yaml", "to_yaml_properties", "untaint", "scale", "extend_with_included_modules_from", "id", "instance_eval", "inspect", "require_library_or_gem", "pretty_print", "klass", "type_cast_code", "clone", "text?", "public_methods", "b64encode", "extended_by", "extend", "require_gem", "freeze", "suppress", "display", "encode64", "instance_values", "po", "type_cast", "`", "__id__", "pretty_print_instance_variables", "methods", "==", "method", "sql_type", "decode64", "gem", "===", "to_json", "subclasses_of", "dup", "nil?", "enable_warnings", "instance_variables", "copy_instance_variables_from", "instance_of?", "load", "name", "poc", "to_param", "instance_exec", "=~", "object_id", "singleton_methods", "decode_b", "null", "unloadable", "taint", "equal?", "silence_stderr", "blank?", "instance_variable_get", "frozen?", "kind_of?", "require", "to_yaml_style"] Regards, Andy Stewart --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
John Barnette
2007-Mar-02 21:25 UTC
Re: Where''s the list of valid attributes / methods for column objects?
Also see: http://api.rubyonrails.org/classes/ActiveRecord/ConnectionAdapters/Column.html ~ j. On 3/2/07, Andrew Stewart <boss-rAnrN1QAkGGttCpgsWEBFlaTQe2KTcn/@public.gmane.org> wrote:> > Hello, > > On 2 Mar 2007, at 05:07, Bill Walton wrote: > > I''m trying to figure out what the valid attributes are on a column > > object. > > The Rails scaffolding generates a list view that uses > > column.column_name for > > example. ActiveRecord::Base#columns says it returns "an array of > > column > > objects for the table associated with this class". But I can''t > > find a list > > of the attributes of / methods on a column object anywhere. > > Try using script/console: > > Let''s say that you have a User model. > > >> User.columns.first.methods > => ["to_a", "respond_to?", "returning", "daemonize", "type", "limit", > "protected_methods", "human_name", "silence_stream", "eql?", > "number?", "instance_variable_set", "precision", "is_a?", "taguri", > "hash", "to_s", "send", "dclone", "remove_subclasses_of", "ri", > "pretty_print_cycle", "primary", "default", "with_options", > "taguri=", "silence_warnings", "pretty_print_inspect", "class", > "tainted?", "private_methods", "primary=", "__send__", "to_yaml", > "to_yaml_properties", "untaint", "scale", > "extend_with_included_modules_from", "id", "instance_eval", > "inspect", "require_library_or_gem", "pretty_print", "klass", > "type_cast_code", "clone", "text?", "public_methods", "b64encode", > "extended_by", "extend", "require_gem", "freeze", "suppress", > "display", "encode64", "instance_values", "po", "type_cast", "`", > "__id__", "pretty_print_instance_variables", "methods", "==", > "method", "sql_type", "decode64", "gem", "===", "to_json", > "subclasses_of", "dup", "nil?", "enable_warnings", > "instance_variables", "copy_instance_variables_from", "instance_of?", > "load", "name", "poc", "to_param", "instance_exec", "=~", > "object_id", "singleton_methods", "decode_b", "null", "unloadable", > "taint", "equal?", "silence_stderr", "blank?", > "instance_variable_get", "frozen?", "kind_of?", "require", > "to_yaml_style"] > > Regards, > Andy Stewart > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---