ActiveRecord オブジェクトのコンストラクターをオーバーライドしようとしています。このように、構築時にパラメーターを渡すオプションが必要です
token = LinkedinToken.new("these_permissions")
しかし、エラーメッセージが表示されます
NoMethodError: undefined method `stringify_keys' for "these_permissions":String
これが私のクラスです
class LinkedinToken < ActiveRecord::Base
attr_accessible :permissions,
:access_token,
:access_secret,
:last_updated
belongs_to :linkedin_info
def initialize(perms = nil)
super
permissions = perms
end
end
注: コンストラクターの 2 行目を削除すると、同じエラーが発生します。
何か案は?