Browse Source

fix images in database and model

Andrew Swistak 6 năm trước cách đây
mục cha
commit
6ff15a5d30
2 tập tin đã thay đổi với 2 bổ sung2 xóa
  1. 1 1
      app/models/image_urls.rb
  2. 1 1
      bot.rb

+ 1 - 1
app/models/image.rb → app/models/image_urls.rb

@@ -1,4 +1,4 @@
-class Image < ActiveRecord::Base
+class ImageUrl < ActiveRecord::Base
   validates :name, presence: true
   validates :url, presence: true
 end

+ 1 - 1
bot.rb

@@ -48,7 +48,7 @@ pm_commands = []
 
 hello = Command.new(:hello, "Says hello!") do |event|
   user = event.author.nickname || event.author.name
-  img = Image.find_by(name: 'happy')
+  img = ImageUrl.find_by(name: 'happy')
 
   greetings = [
     "Hi there, #{user}",