Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unitialized constant User::Message #1

Open
obrie opened this issue Aug 6, 2011 · 1 comment
Open

unitialized constant User::Message #1

obrie opened this issue Aug 6, 2011 · 1 comment
Assignees

Comments

@obrie
Copy link
Member

obrie commented Aug 6, 2011

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).

@ghost ghost assigned obrie Aug 6, 2011
@cobalamin
Copy link

Same here! I, personally, had to use the
https://github.com/chengz/has_messages
fork to make it migrate for rails 3, too. Is this intended, or is there another possibility to do so...?

Also, is this rails3 compatible at all, or will it be?

Thanks! It looks great so far.
Simon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants