0

The merit ruby gem is not adding the points to the user with the "user.passion.present" added. It works without it. I set everything up with working with Devise and Merit gems. Everything seems to work except this.

module Merit
  class PointRules
    include Merit::PointRulesMethods

    def initialize
      score 50, :on => 'user/registrations#create', model_name: 'User'


        score 10, :on => 'user/registrations#update', model_name: 'User' do |user|
         user.passion.present?
       end




      #
      # score 15, :on => 'reviews#create', :to => [:reviewer, :reviewed]
      #
      # score 20, :on => [
      #   'comments#create',
      #   'photos#create'
      # ]

      score 20, on: 'lyrics#create', to: :user, description: 'Plus 20 points'

      score (-20), on: 'lyrics#destroy', to: :user
    end
  end
end
CC Evans
  • 39
  • 7

1 Answers1

0

Did you add the instance variable to the update overridden action? See wiki page: https://github.com/tute/merit/wiki/How-to-grant-badges-on-user-registration-using-Devise.

TuteC
  • 4,342
  • 30
  • 40
  • Yea, I added the stuff on that page. Is there anything else I have to add to the controller that I am missing? – CC Evans Mar 30 '15 at 00:22
  • Nope, that should be all. Obvious question: does the user have a passion when you trigger that action? Another one: can you paste the whole log for the `#update` action when it doesn't work? – TuteC Mar 30 '15 at 21:08