#673 ✓invalid
Don Ziesig

user has_many log_entries, log_entry belongs to user

Reported by Don Ziesig | March 13th, 2010 @ 11:04 PM

class User < ActiveRecord::Base

hobo_user_model # Don't put anything above this

fields do * * end

has_many :log_entries;

end

class LogEntry < ActiveRecord::Base

hobo_user_model # Don't put anything above this

fields do * * user_id :integer; end

belongs_to :user

end

end;

In rails, I can set the value of user_id in the log_entry controller. Since there are no appropriate members in the log_entry controller, I tried (unsuccessfully) to get current_user in the log_entry model. I didn't think this would be visible and I was right.

This is a very simple hobo program. All I want it to do is keep the log entries of separate users separate in the db and at the UI.

When I create log entries, the user_id field is not populated.

Am I missing something simple?

Thanks in advance,

Don Ziesig

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

People watching this ticket

Pages