0

私はしばらくこれにいて、大きな失敗の壁にぶつかっています...

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

クラス: デフムーブ(ゲーム)

    # 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
4

1 に答える 1

0

純粋な Ruby/Rails 初心者のやり方で、私はこれを間違えたようです。この問題は、DB スキーマのいくつかのクレイジーな問題に起因していました。すべてを解決し、古い GIT コミットに基づいてプラグインを再インストールすると、この gem を起動して実行することができました。

うまくいけば、奇妙な方法で、これがこの Gem を試すことに興味を持っている可能性のある別の SO ユーザーに役立つことを願っています。

于 2013-09-23T07:55:34.607 に答える