-
Notifications
You must be signed in to change notification settings - Fork 19
Open
Description
batterhead opened this issue
hi,
thanks for your effort creating the plugin. i have installed has_messages 0.4.1 and state_machine 0.10.4 with rails 2.3.10, and tried to send some message with the following lines. however the system returned with "unitialized constant User::Message". what am i missing? can you show more usage about the syntax to use has_messages? many thanks.
User model
class User < ActiveRecord::Base
has_messages
end
def self.send_msg()
message = User.current_user.messages.build # i want to send a message by the current user
message.to 2 # to user with id = 2. i am not sure this is correct or not.
message.subject = ’Hey!’
message.body = ’Does anyone want to go out tonight?’
message.deliver
end
batterhead
This ticket has 0 attachment(s).
Metadata
Metadata
Assignees
Labels
No labels