我在这已经有一段时间了,撞上了一堵失败的长城.
我想从Mochi Media的服务器上提取一些游戏信息。我已经安装了API钩子,但是当我尝试使用Dragonfly访问文件信息时,我得到了以下错误:
undefined method `file_uid' for #<Game:0x007fba5e0bf188>有人能看到我在做什么奇怪的事吗?
模型:
class Game < ActiveRecord::Base
attr_accessible :description, :name, :file, :image
image_accessor :image
image_accessor :file
validates :name, uniqueness: true
validates :name, presence: true
end类: def移动(游戏)
# Grab the mochi game from the queue
mochi_game = Mochi.find(game.id)
if mochi_game
# Setup a new game object
game = Game.new
# Pull the game's name
game.name = mochi_game.name
# Pull the thumb & game file
game.image_url = mochi_game.image_url
game.file_url = mochi_game.file_url
# Pull the metadata
game.description = mochi_game.description
# Save the game to our db
game.save
end
return false
end迁移:
class AddImageAndGametoGames < ActiveRecord::Migration
def up
add_column :games, :image_uid, :string
add_column :games, :file_uid, :string
end
def down
remove_column :games, :image_uid, :string
remove_column :games, :file_uid, :string
end
end发布于 2013-09-23 07:55:34
看起来又一次,以纯Ruby/Rails新手的方式,我成功地弄错了。这个问题源于我的DB模式中的一些疯狂的问题。一旦我完成了所有这些工作,并重新安装了基于一个较老的GIT提交插件,我就能够启动和运行这个创业板。
希望,在一些奇怪的方式,这有助于另一个这样的用户谁可能有兴趣尝试这个宝石。
https://stackoverflow.com/questions/18904929
复制相似问题