joshfrench / rakismet

Easy Akismet and TypePad AntiSpam integration for Rails
MIT License
355 stars 46 forks source link

Customized parameters #1

Closed dmathieu closed 14 years ago

dmathieu commented 14 years ago

Hello,

I'm using rakismet with some customized parameters.

has_rakismet :author => proc { user.dispname },
           :author_email => proc { user.email },
           :author_url => proc { user.website },
           :comment_type => proc { 'comment' },

However when I'm like that, I get the following error from Akismet : "Missing required field: user_ip.". But I have a user_ip field in my model, which is appropriately filled.

When I declare the following in my model :

has_rakismet :author => proc { user.dispname },
           :author_email => proc { user.email },
           :author_url => proc { user.website },
           :comment_type => proc { 'comment' },
           :user_ip => :user_ip,
           :user_agent => :user_agent,
           :referrer => :referrer

It works well. So I guess when we customize some elements, Rakismet isn't able to take the other ones by itself.

joshfrench commented 14 years ago

Thanks for the heads-up, I'll take a look. Can you tell me which version of Rakismet you're using?

dmathieu commented 14 years ago

I'm using the edge version (I have a git submodule to the repository).

joshfrench commented 14 years ago

Damien, can you pull & let me know if this fixes your issue? You shouldn't have to specify :user_ip => :user_ip.

dmathieu commented 14 years ago

It works well now. Thank you :)