Class: Badge
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Badge
- Includes:
- Mongoid::Document, Mongoid::Timestamps
- Defined in:
- lib/badgeable/adapters/active_record_adapter.rb,
lib/badgeable/adapters/mongoid_adapter/badge.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.find_or_create_by_name(name, options) ⇒ Object
36 37 38 |
# File 'lib/badgeable/adapters/active_record_adapter.rb', line 36 def self.find_or_create_by_name(name) Badge.where(:name => name).first || create(:name => name) end |
Instance Method Details
#icon ⇒ Object
40 41 42 |
# File 'lib/badgeable/adapters/active_record_adapter.rb', line 40 def icon "/images/#{name.parameterize}.jpg" end |