specify columns from has many through association Rails
I have three models.

    User
    has_many :boards through => :celebrations
    
    Board
    has_many  :users, :through => :celebrations do
    	       def by_role(role) 
    	       find(:all, :conditions => ["celebrations.role = ?", role])
    	       end
               end
    
    Celebration
    :belongs_to :user
    :belongs_to :board


Celebration Table

       create_table :celebrations do |t|
    	  t.column :board_id,        :int, :null => false
    	  t.column :user_id,         :int, :null => false 
    	  t.column :role, 			 :string,  :null => false
    	  t.column :token, 			 :string
    	  t.column :accepted,    :boolean, :default => false
          t.timestamps

In the controller:
  

      @board = Board.find(session[:board_id])
        @friends = @board.users.by_role("FRIEND")

In the view:

    <% for friend in @friends do %>
    <%= friend.name %>
    <%= friend.email %>

However when I do the following:

    <% friend.celebration.accepted %> 
 
I get the following error:

    undefined method `celebration' for #<User:0x104788c00>



How can I access the column 'accepted' in the celebrations table returned along with the record using the model extension "by_role(role)".

Thank you for your help in advance.

specify columns from has many through association Rails
===

I have three models.

    User
    has_many :boards through => :celebrations
    
    Board
    has_many  :users, :through => :celebrations do
    	       def by_role(role) 
    	       find(:all, :conditions => ["celebrations.role = ?", role])
    	       end
               end
    
    Celebration
    :belongs_to :user
    :belongs_to :board


Celebration Table

       create_table :celebrations do |t|
    	  t.column :board_id,        :int, :null => false
    	  t.column :user_id,         :int, :null => false 
    	  t.column :role, 			 :string,  :null => false
    	  t.column :token, 			 :string
    	  t.column :accepted,    :boolean, :default => false
          t.timestamps

In the controller:
  

      @board = Board.find(session[:board_id])
        @friends = @board.users.by_role("FRIEND")

In the view:

    <% for friend in @friends do %>
    <%= friend.name %>
    <%= friend.email %>

However when I do the following:

    <% friend.celebration.accepted %> 
 
I get the following error:

    undefined method `celebration' for #<User:0x104788c00>



How can I access the column 'accepted' in the celebrations table returned along with the record using the model extension "by_role(role)".

Thank you for your help in advance.
