Use:

ETL::Engine.table(table_name, connection)

And it will return a modified name if necessary. This method will also
construct the temp table if necessary.

Word of warning, I am still seeing behavior with MySQL whereby indexes
are not being retained in the temp table and thus will be lost when
the temp table and renamed to the production table. You have been
warned.

V/r
Anthony

On 9/16/07, Thibaut Barrère <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I'm using ActiveRecord in my screens, and must admit I've become addicted
> because it's very handy:
>
> screen(:fatal) do
>    well_known_customer = CustomerDimension.find_by_name("Acme")
>   assert_not_nil well_known_customer, "Acme customer not found"
>   assert_equal %w(chocolate ice-cream),
> well_known_customer.preferred_products.map(&:name)
> end
>
> I've spotted a limitation though: when using use_temp_tables, ActiveRecord
> tables are not affected and the target table still is customer_dimension
> instead of tmp_customer_dimension.
>
> This most likely impacts the following areas:
> - model source
> - foreign key look-up with ActiveRecord resolver
> - screens relying on ActiveRecord (example above)
>
> A work-around which seems to work is:
>
> CustomerDimension.set_table_name('tmp_customer_dimension')
>
> before the screen (in my case).
>
>  Thoughts ?
>
> Thibaut
> _______________________________________________
> Activewarehouse-discuss mailing list
> Activewarehouse-discuss@rubyforge.org
> http://rubyforge.org/mailman/listinfo/activewarehouse-discuss
>
>


-- 
Cell: 321 473-4966
Current Location: Melbourne, FL
_______________________________________________
Activewarehouse-discuss mailing list
Activewarehouse-discuss@rubyforge.org
http://rubyforge.org/mailman/listinfo/activewarehouse-discuss

Reply via email to