lib/merit/rule.rb
# Get rule's related Badge.
Get rule's related Badge.
Get rule ' s related Badge .
def badge
      if @badge.nil?
        badges = Badge.where(:name => badge_name)
        badges = badges.where(:level => level.to_s) unless level.nil?
        @badge = badges.first
      end
      @badge
    end
def badge if @badge . nil? badges = Badge . where ( :name => badge_name ) badges = badges . where ( :level => level . to_s ) unless level . nil? @badge = badges . first end @badge end
Get rule's related Badge.
Get rule ' s related Badge .