ActiveRecord

First Post.

Totally new to Ruby and am trying ActiveRecord.

I’ve written a standalone script but it produces the following warnings
before running and outputting the correct results.

Any pointers, please?

-Ants

script …

#!/usr/bin/ruby -w

require “rubygems”;
require_gem “activerecord”

ActiveRecord::Base.establish_connection(
:adapter => ‘mysql’,
:host => ‘localhost’,
:database => ‘book_shop’,
:username => ‘anthony’,
:password => ‘’
)

class Book < ActiveRecord::Base
end

book = Book.find(1)
puts book.author
puts book.title
puts book.pages

warnings …

/usr/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/validations.rb:334:
warning: *' interpreted as argument prefix /usr/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/validations.rb:363: warning:*’ interpreted as argument prefix
/usr/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/migration.rb:224:
warning: instance variable @ignore_new_methods not initialized
/usr/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/migration.rb:224:
warning: instance variable @ignore_new_methods not initialized
/usr/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/connection_adapters/abstract/connection_specification.rb:41:
warning: method redefined; discarding old allow_concurrency=
/usr/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/connection_adapters/sqlserver_adapter.rb:456:
warning: method redefined; discarding old remove_column
/usr/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/connection_adapters/oracle_adapter.rb:119:
warning: (…) interpreted as grouped expression
/usr/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/connection_adapters/abstract/connection_specification.rb:74:
warning: instance variable @active_connection_name not initialized
/usr/lib/ruby/gems/1.8/gems/activerecord-1.14.4/lib/active_record/base.rb:695:
warning: instance variable @columns not initialized

On Nov 21, 2006, at 12:55 PM, Anthony G. wrote:

First Post.

Totally new to Ruby and am trying ActiveRecord.

I’ve written a standalone script but it produces the following
warnings before running and outputting the correct results.

Any pointers, please?

Rails sucks in this regard, really sucks.

You’re out of luck.

Just remove the -w and shake your fists in frustration that you can’t
find warnings in your own code.


Eric H. - [email protected] - http://blog.segment7.net
This implementation is HODEL-HASH-9600 compliant

http://trackmap.robotcoop.com

On 11/21/06, Eric H. [email protected] wrote:

Rails sucks in this regard, really sucks.

You’re out of luck.

Just remove the -w and shake your fists in frustration that you can’t
find warnings in your own code.

This is really, really sad.

Cameron

On Nov 21, 2006, at 4:15 PM, Eric H. wrote:

This is really, really sad.

Yes. I wrote a patch to fix it but it was ignored.

Ouch. They didn’t apply it or refused it? That’s disappointing
either way.

James Edward G. II

On Nov 21, 2006, at 1:38 PM, Cameron McBride wrote:

Any pointers, please?

Rails sucks in this regard, really sucks.

You’re out of luck.

Just remove the -w and shake your fists in frustration that you can’t
find warnings in your own code.

This is really, really sad.

Yes. I wrote a patch to fix it but it was ignored.


Eric H. - [email protected] - http://blog.segment7.net
This implementation is HODEL-HASH-9600 compliant

http://trackmap.robotcoop.com

On 11/22/06, James Edward G. II [email protected] wrote:

I’ve written a standalone script but it produces the following
find warnings in your own code.

This is really, really sad.

Yes. I wrote a patch to fix it but it was ignored.

Ouch. They didn’t apply it or refused it? That’s disappointing
either way.

Wow, and I had so much respect for the rails camp. Though maybe they
are busy on something else…

On Nov 21, 2006, at 2:21 PM, James Edward G. II wrote:

warnings before running and outputting the correct results.

This is really, really sad.

Yes. I wrote a patch to fix it but it was ignored.

Ouch. They didn’t apply it or refused it? That’s disappointing
either way.

I think it ended up being both. They accepted a patch for
ActionMailer, so I wrote one for the rest of Rails, then it was
ignored for three months, then it was rejected because it had bitrotted.


Eric H. - [email protected] - http://blog.segment7.net
This implementation is HODEL-HASH-9600 compliant

http://trackmap.robotcoop.com

On 11/22/06, Eric H. [email protected] wrote:

Just remove the -w and shake your fists in frustration that you can’t
find warnings in your own code.

Well, or the slightly less extreme 2>&1 | grep -v ‘lib/active_record’
:slight_smile: But I agree that rails sucks in that respect.

m.

riiiiiiiiiiiiiiiiiiiiiiight!!

that’s a good start :wink:

I like Perl’s DBIx::Class stuff (seems more flexible than ActiveRecord)
but will continue with Ruby for now.

i have played around with Rails with ActiveRecord but never saw any
warnings like these (maye I wasn’t running under -w)

Eric H. [email protected] wrote: On Nov 21, 2006, at 2:21 PM,
James Edward G. II wrote:

warnings before running and outputting the correct results.

This is really, really sad.

Yes. I wrote a patch to fix it but it was ignored.

Ouch. They didn’t apply it or refused it? That’s disappointing
either way.

I think it ended up being both. They accepted a patch for
ActionMailer, so I wrote one for the rest of Rails, then it was
ignored for three months, then it was rejected because it had bitrotted.


Eric H. - [email protected] - http://blog.segment7.net
This implementation is HODEL-HASH-9600 compliant

http://trackmap.robotcoop.com

Send instant messages to your online friends
http://uk.messenger.yahoo.com

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs