Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Agrega talent_rules a generators. Admite grant_badges sin bloque (gra…
…nts always).
- Loading branch information
Showing
6 changed files
with
39 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
class TalentRules | ||
include Talent::Rules | ||
|
||
def initialize(user) | ||
user ||= User.new | ||
|
||
# If it creates user, grant badge | ||
# grant_on 'users#create', :badge => 'just', :level => 'registered' | ||
|
||
# If it has 10 comments, grant commenter-10 badge | ||
# grant_on 'comments#create', :badge => 'commenter', :level => 10 do | ||
# user.comments.count == 10 | ||
# end | ||
|
||
# If it has 20 comments, grant commenter-20 badge | ||
# grant_on 'comments#create', :badge => 'commenter', :level => 20 do | ||
# user.comments.count == 20 | ||
# end | ||
|
||
check_new_actions # FIXME: Should be called somewhere else? | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.