#22 new
James B. Byrne

Missing/Empty? import/postgresql.rb

Reported by James B. Byrne | May 12th, 2009 @ 02:40 PM

I am just trying out ar-extensions (0.9.1) for the first time and when I do this:

    require 'ar-extensions/adapters/postgresql'
    require 'ar-extensions/import/postgresql'
...
      if new_rates.size % batch_size == 0 
        CurrencyExchangeRate.import new_rates, 
          :validate => validate
        new_rates = [] # empty the rates array
      end
...

Then I see this:

undefined method `import' for #Class:0x2b2e4c6dd850 (NoMethodError)

If I look at gems/ar-extensions-0.9.1/lib/ar-extensions/import/postgresql,rb I see an empty file:

$ ll /usr/lib64/ruby/gems/1.8/gems/ar-extensions-0.9.1/lib/ar-extensions/import/* ... -rw-r--r-- 1 root root 0 May 11 09:43 /usr/lib64/ruby/gems/1.8/gems/ar-extensions-0.9.1/lib/ar-extensions/import/postgresql.rb ...

Is this intended?

Comments and changes to this ticket

  • Zach Dennis

    Zach Dennis May 12th, 2009 @ 02:44 PM

    Hi James,

    I know this hasn't been implemented as I don't use PostgreSQL, but I am surprised by the error. It should fall back one insert per row. I'll look into this.

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

ActiveRecord::Extension (aka ar-extensions) is a plugin to extend and
enhance the functionality of ActiveRecord. It starts by adding better
find support for ActiveRecord. It then adds mass data import
capabilities which are highly efficient and lastly it supports to_csv
functionality.

It also introduces a cool concept of creating easily extendable pieces
of ActiveRecord functionality, so developers don't have to understand
ActiveRecord internals or have the fear of breaking ActiveRecord
itself.

People watching this ticket

Pages