Skip to content

unitialized constant User::Message #1

@obrie

Description

@obrie

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

original LH ticket

This ticket has 0 attachment(s).

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions