Raphael Bauduin | 8 Nov 21:22
Picon

Re: extract fixtures from database?

On 11/8/05, Jeremy Kemper <jeremy@...> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> On Nov 8, 2005, at 11:16 AM, Raphael Bauduin wrote:
> >> # dump foobar db to ./foobar
> >> $ rake dump_fixtures DB=foobar DEST=./foobar
> > I get this error:
> >
> > rake aborted!
> > undefined method `table_names' for
> > #<ActiveRecord::ConnectionAdapters::PostgreSQLAdapter:0xb75e3cf4>
> >
> > I don't find the table_names method anywhere in the api. I looked for
> > such a method in myslq but didn't either. Am I missing something
> > obvious?
>
> Oops! That's a method I defined. For PostgreSQL:
>
> table_names = ActiveRecord::Base.connection.select_values(<<-end_sql)
>    SELECT c.relname
>    FROM pg_class c
>      LEFT JOIN pg_roles r     ON r.oid = c.relowner
>      LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
>    WHERE c.relkind IN ('r','')
>      AND n.nspname IN ('myappschema', 'public')
>      AND pg_table_is_visible(c.oid)
> end_sql

Thanks. Time for me to upgrade my postgres to  8.1 :-)

Raph

>
>
> jeremy
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.2 (Darwin)
>
> iD8DBQFDcQNwAQHALep9HFYRAptzAKC3mho6d1635McnAR/DKjV5phuzGACfaJxn
> XZEDeAT4eZxbkZsQs75hQHQ=
> =Ra0A
> -----END PGP SIGNATURE-----
> _______________________________________________
> Rails mailing list
> Rails@...
> http://lists.rubyonrails.org/mailman/listinfo/rails
>

Gmane