Displaying 1 result from an estimated 1 matches for "_real_columns".
2005 Apr 23
2
[Tip] Introspection to determine if a column may be null
...omed. As our implementations for any other adaptors.
# From my own lib/rails_extensions.rb file, included in
config/environment.rb
class ActiveRecord::ConnectionAdapters::Column
def required?
@required
end
end
class ActiveRecord::ConnectionAdapters::PostgreSQLAdapter
alias_method :_real_columns, :columns
def columns( table_name, name=nil )
cols = _real_columns( table_name, name )
cols.each{ |col|
sql = "select is_nullable from information_schema.columns where
table_name=''#{table_name}'' and column_name=''#{col.name}''"...