-
Notifications
You must be signed in to change notification settings - Fork 198
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
Feature Request: Ability to add other fields to badge definition #77
Comments
This was discussed in: #28 (comment) May I ask how would you use custom fields? |
A couple of ways. Our app will probably end up with fifty or more badges a user can earn. We'd like the ability to group them, sort them, and make them visible/active or not. So initially we have discussed needing: :order=> flags. Granted, I could make my own badge_attribute table and link it over to Merit::Badge by badge ID, but that's not really clean. Thanks |
I'm thinking of getting rid of the level attribute. I'm interested in your thoughts of that. If you wouldn't use it as merit intends right now, you may use it as 'group'. I'll think about the other ones. |
We're not currently using level, and anything that needs a different level of activity, we're tracking ourselves (log-ins,score, etc). Maybe sub-classing ourselves is the right way to go about this |
|
Yes, a custom fields hash would be a great way to do it. |
Howdy
I'd like to request the ability to add other optional fields to the badge definition in the merit.rb file. Something like this:
Merit::Badge.create!({
:id=> 7,
:name=>'6 Months Active',
:image=>'badges/6months.png',
:description=>'Users that are active after six months',
:my_other_field=>"foo",
:my_other_field2=>"bar"
})
etc...
The text was updated successfully, but these errors were encountered: