Questions tagged [merit-gem]

Merit is a ruby gem for handling reputation (badges, points and rankings) in Rails applications.

61 questions
0
votes
0 answers

Rails - Ruby gem merit score not adding if Model cannot be guessed from the controller

I am working with merit gem and I have a pages controller and an action 'fan'. I need the merit gem to add 10 score when user be a fan of a page. Modal is 'Fan'. Fan has a user. score 10, :on => 'pages#fans', model_name: 'Fan', :to => :user But…
Abhi
  • 3,361
  • 2
  • 33
  • 38
0
votes
1 answer

Rails 3: Merit Gem to show records by seasons through dropdown button

class StaticPagesController < ApplicationController def home end def leaderboard @scores = Merit::Score.top_scored end end I am using the merit system for my ruby on rails application and i want to show records by seasons (Summer, Fall,…
arinh
  • 206
  • 1
  • 12
0
votes
1 answer

Firing javascript from merit gem when certain activities arise.

I am trying to use the merit gem to handle points and badges for a website. I want certain javascript animations/events to fire when the user the achieves certain things. IE, when the point score increases it shows an animation of their score going…
Nigel Kehler
  • 13
  • 1
  • 3
0
votes
0 answers

Merit does not create badge in DB using devise

I have a rails app using devise, rails 4 and ruby 2.1.0. Devise is using the user model with config.scoped_views = true. I have followed the this wiki for setting up merit using devise. When a user registers the badge is not added to the database -…
mjwb
  • 1
0
votes
1 answer

Merit gem no longer works on Rails 4.1

So I loaded a Badge with an image just fine on rails 3.2 badges = [ {id: 1, name: 'Democratic-Society', description: "Voted for two bands", image: "demo_society2.gif"} ] badges.each do |badge| Merit::Badge.create!(badge) end But I just updated…
mystic cola
  • 1,465
  • 1
  • 21
  • 39
0
votes
4 answers

Sorting users by points (using merit gem)

What's the best way to order a users list by their points generated by the merit gem? I'm having difficulty doing so because merit probably doesn't save it's data in the db. So far, I'm caching merit points in the users table, I was just wondering…
Zuhaib Ali
  • 3,344
  • 3
  • 20
  • 32
0
votes
1 answer

Rails 4 / Devise / Merit gem : no target_obj found on Rule#applies?

I'm trying to implement a badge system in my Rails app using the Merit gem. I want to give a badge to the 100 first users of my app. So I add this code to badge_rules.rb grant_on 'registrations#create', badge: 'Pioneer', model_name: 'User', to:…
Ruff9
  • 1,163
  • 15
  • 34
0
votes
1 answer

Rails 4 : basic use of Merit gem with Devise

Using the merit gem, I want to create a Pioneer badge for the first 100 users of my app. The code in merit.rb Merit::Badge.create!( id: 1, name: 'Pioneer', description: "Belongs to the 100 first users of the site", image:…
Ruff9
  • 1,163
  • 15
  • 34
0
votes
1 answer

Rails 4 + Merit + Devise: set a badge for user after registration

I have a trouble at this situation. I followed this manual, but it don't helped me. Here's my files: routes.rb: devise_for :users, controllers: { omniauth_callbacks: 'users/omniauth_callbacks', registrations: 'registrations'…
0
votes
1 answer

Rails: Is it possible to have temporary badges with Merit Gem

I would like to use the Merit Gem to create a badges and points system on my website. However, I would like it for some badges to reset after each month. For example, a monthly badge of 20 comments. This would require users to be consistent on the…
zenben1126
  • 685
  • 1
  • 7
  • 25
0
votes
1 answer

Merit Gem: How to expire cached values?

I'm trying to cache User data, but find that points generated by the Merit gem aren't being expired properly. Normally I could do something like this in Rails: belongs_to :user, touch: true Is there a way to accomplish the same thing with Merit so…
John Trichereau
  • 626
  • 9
  • 22
0
votes
2 answers

Merit Gem: how to grab a User's points for a single day?

How can I grab a User's points for a single day (i.e. 'Today' or 'Yesterday') using the Merit gem? I tried: current_user.points.where("created_at >= ?", Time.zone.now.beginning_of_day) but that doesn't work.
John Trichereau
  • 626
  • 9
  • 22
0
votes
3 answers

Rails: Merit Gem Badge Not Registering or Displaying

I set up the following badge which registered in DB: merit.rb Merit::Badge.create!({ id: 1, name: 'Five Tasks' custom_fields: { img_url: '/images/badge.gif' } }) I set up the following rule: badge_rules.rb grant_on 'tasks#create', :badge => 'Five…
user1648020
  • 97
  • 1
  • 12
-1
votes
1 answer

Rails 3: Merit Leaderboard (HMBTM association) for venues & seasons

I am trying to understand how to pass my @venues variable into the 'merit_scores_override.rb' and use SQL to categorize based on the venues associated with that season. So when leaderboard has params of 'since_date' it takes all the venues from that…
-1
votes
1 answer

Rails 3: Filtering merit points by category in leaderboard

The real tactical question I am facing is all categories are set as 'default' therefore if I make options[:category] = 'default' it only adds the points that have no category. Therefore if i add points to cateogry 'arin' it will not be counted to…
arinh
  • 206
  • 1
  • 12