Undefined method `table_name' for REXML::Comment:Class

i am using rexml and try to find id from Comment table i got the error

my code is like this…

XPath.each(new_article, ‘comments’) do |comments|
XPath.each(comments, ‘comment’) do |new_comment|
c_oldid =
XmlMigratedData.find(:first,:conditions=>[“model_type=? and
ext_id=?”,“Comment”,new_comment.attribute(‘id’).to_s])
if c_oldid !=nil
debugger
@comment=Comment.find(c_oldid.int_id)
@comment.update_attributes(:article_id=>article.id) if
@comment
else
logger.error("#{comment.attribute(‘id’).to_s} for
#{old_id}")
end
end
end

/usr/lib/ruby/gems/1.8/gems/rails-2.0.2/lib/commands/runner.rb:47:
undefined method `find’ for REXML::Comment:Class (NoMethodError)

Suggest me…

On Sep 26, 5:51 pm, Neetin K. [email protected]
wrote:

i am using rexml and try to find id from Comment table i got the error

Rexml’s Comment class is shadowing your own. Either don’t include
REXML in the model that is doing this processing (so you’ll need to
prefix rexml classes with REXML::slight_smile: or replace Comment with ::Comment

Fred

Frederick C. wrote:

On Sep 26, 5:51�pm, Neetin K. [email protected]
wrote:

i am using rexml and try to find id from Comment table i got the error

Rexml’s Comment class is shadowing your own. Either don’t include
REXML in the model that is doing this processing (so you’ll need to
prefix rexml classes with REXML::slight_smile: or replace Comment with ::Comment

Fred

thank’s a lot it solved my problem

Hi Neetin,

I would like to find out how you solved the problem with REXML’s
comment overshadowing your own Comment model. I am not including REXML
myself, but I assume that a part of Rails is doing so. How do I not
include it then?

Thank you.

On Sep 29 2008, 3:20 pm, Neetin K. <rails-mailing-l…@andreas-