On Sep 26, 5:51 pm, Neetin Kumar <[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::) or replace Comment with ::Comment
Fred
> 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....
> --
> Posted viahttp://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---