lib/cinch/plugins/suggestions.rb
def command_suggest(m, title)
        if title.empty?
          command_help(m)
        else
          new_suggestion = Suggestion.create(
            :title      => title,
            :user       => m.user.nick
          )

          if new_suggestion.saved?
            m.user.send "Added title suggestion \"#{new_suggestion.title}\""
          else
            new_suggestion.errors.each do |e|
              m.user.send e.first
            end
          end
        end

      end
# Add the user's suggestion to the database
Add the user's suggestion to the database
Add the user ' s suggestion to the database
def command_suggest(m, title)
        if title.empty?
          command_help(m)
        else
          new_suggestion = Suggestion.create(
            :title      => title,
            :user       => m.user.nick
          )
          if new_suggestion.saved?
            m.user.send "Added title suggestion \"#{new_suggestion.title}\""
          else
            new_suggestion.errors.each do |e|
              m.user.send e.first
            end
          end
        end
      end
def command_suggest ( m , title ) if title . empty? command_help ( m ) else new_suggestion = Suggestion . create ( :title => title , :user => m . user . nick ) if new_suggestion . saved? m . user . send "Added title suggestion \"#{new_suggestion.title}\"" else new_suggestion . errors . each do | e | m . user . send e . first end end end end
Add the user's suggestion to the database
Add the user ' s suggestion to the database
m
title