lib/merit/model_additions.rb in merit-1.6.2 vs lib/merit/model_additions.rb in merit-1.7.0

- old
+ new

@@ -17,11 +17,11 @@ # Delegate methods from meritable models to their sash def _merit_delegate_methods_to_sash methods = %w(badge_ids badges points add_badge rm_badge - add_points substract_points) + add_points substract_points subtract_points) methods.each { |method| delegate method, to: :_sash } end def _merit_orm_specific_config if Merit.orm == :mongo_mapper @@ -38,10 +38,10 @@ end end end def _merit_define_badge_related_entries_method - meritable_class_name = caller[1][/`.*'/][8..-3] + meritable_class_name = name.demodulize Badge._define_related_entries_method(meritable_class_name) end # _sash initializes a sash if doesn't have one yet. # From Rails 3.2 we can override association methods to do so