ActiveRecord::Extensions 0.5.2 Released!

ActiveRecord::Extensions 0.5.2 is released!

This release allows you to install “ar-extensions” as a rubygem.

gem install -r ar-extensions

Zach
http://www.continuousthinking.com/tags/arext

much appreciated Zach

cheers

Zach,

I have installed the gem and in my .rb file i use

require ‘ar-extensions’

everything runs as expected but I get the following warnings

FasterCSV is not installed. CSV functionality will not be included.
C:/applications/ruby/lib/ruby/gems/1.8/gems/ar-extensions-0.5.2/lib/ar-extensions/temporary_table.rb:120:
warning: parenthesize argument(s) for future version
advertisement_test.rb: No such file or directory -

Firstly, am I using it correctly and secondly is there anyway to
suppress the errors.

cheers

On Mar 15, 1:49 am, Jim A. [email protected] wrote:

warning: parenthesize argument(s) for future version
advertisement_test.rb: No such file or directory -

Firstly, am I using it correctly and secondly is there anyway to
suppress the errors.

Michael W.'s reply will fix the CSV warning. Perhaps I should put
the to_csv functionality in a separate gem rather then giving the user
warnings.

I will fix the ruby warning in the next release.

Let me know if you have any other questions.

Zach
http://www.continuousthinking.com

Jim A. wrote:

warning: parenthesize argument(s) for future version
advertisement_test.rb: No such file or directory -

Firstly, am I using it correctly and secondly is there anyway to
suppress the errors.

cheers

sudo gem install fastercsv


Michael W.

Hey Zach, this sounds like a very good idea.

-Conrad

Zach,

What about the warning message?

cheers

What version of activerecord extensions and what version of ruby are
you using and what version of fastercsv?

Zach

F:\Documents and Settings\Administrator>ruby -v
ruby 1.8.5 (2006-08-25) [i386-mswin32]

F:\Documents and Settings\Administrator>gem list --local
activerecord (1.15.3, 1.15.2, 1.14.4)
ar-extensions (0.5.2)
fastercsv (1.2.0)

Same pattern repeats on fedora (same ruby, latest activerecord, ar-ext.,
fastercsv)

It’s an odd one.

Zach, I can’t get to_csv to work… Not sure what I’m missing.

ruby script/console (dev env)
Model.find(:first) < works
Model.find(:first, :conditions => {:created_at_gt => Time.now - 1.week}
< works, so ar-extensions is registering…

But…

Model.find(:first).to_csv
NoMethodError: undefined method to_csv' for #<Model:0xb6b05b74> from /usr/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/active_record/base.rb:1860:inmethod_missing’
from (irb):10

fastercsv is installed, any ideas?

I apologize for this issue, in your model put:

class YourModel < ActiveRecord::Base
include ActiveRecord::Extensions::FindToCSV
end

You don’t have to to this if you’re working on array of ActiveRecord
models though.

Would you prefer the above, or do not have to do this or do use
declarative style hints like below?

class YourModel < ActiveRecord::Base
acts_on_to_csv
end

I will get this fixed so you don’t have to do this and get a 0.5.4
release out which solves this issue and also the ruby warning on the
temporary_tables file.

Zach