Project

General

Profile

@project.nil? when override text attribute for WikiContent

Added by Anh Kỳ Huỳnh over 14 years ago

Hi all,

For some reasons, I want to override the :text attribute for WikiContent class. I add my own defition by using module including:

  def text
    puts "info: project = #{@project if @project}" 
    st = read_attribute(:text)
    # some more stuff with st
    return st
  end

The strange thing is that I always get project == nil inside my own @text method. This isn't occur when I use the same method to override :description attribute for News class.

Why is this strange?

Thank you for your helps,

Regards,

--
Anh K. Huynh


Replies (1)

RE: @project.nil? when override text attribute for WikiContent - Added by Anh Kỳ Huỳnh over 14 years ago

Below my Redmine environment:

About your application's environment
Ruby version              1.8.7 (i386-freebsd8)
RubyGems version          1.3.5
Rails version             2.1.2
Active Record version     2.1.2
Action Pack version       2.1.2
Active Resource version   2.1.2
Action Mailer version     2.1.2
Active Support version    2.1.2
Edge Rails revision       303c3187e8e46e554f33d97c691791a8f810b84c
Application root          /path/to/myproject/
Environment               development
Database adapter          mysql
Database schema version   20091115061821

About your Redmine plugins
Facebook Connect plugin   0.0.1
Course Plugin             0.0.1
Blog Plugin               1.1.0
Redmine Vote plugin       0.0.2
    (1-1/1)