0
不是值,即屬性的名稱。是的,真實的。我不知道該怎麼回事。RSpec更改模型屬性名稱
遷移:
class CreateFolders < ActiveRecord::Migration
def change
create_table :folders do |t|
t.string :name, null: false
t.timestamps
end
change_table :bookmarks do |t|
t.belongs_to :folder
end
end
end
的架構:
ActiveRecord::Schema.define(version: 20140424065045) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
create_table "bookmarks", force: true do |t|
t.string "name", null: false
t.string "url", null: false
t.datetime "created_at"
t.datetime "updated_at"
t.integer "folder_id"
end
create_table "folders", force: true do |t|
t.string "name", null: false
t.datetime "created_at"
t.datetime "updated_at"
end
end
它所顯示的rails c
內:
[3] pry(main)> Bookmark
=> Bookmark(id: integer, name: string, url: string, created_at: datetime, updated_at: datetime, folder_id: integer)
而現在,我們巨大的突出的問題:
[3] pry(#<RSpec::Core::ExampleGroup::Nested_2::Nested_1>)> Bookmark
=> Bookmark(id: integer, name: string, url: string, created_at: datetime, updated_at: datetime, folders_id: integer)
注意最後一個屬性出現的名字:folders_id
有誰知道在搞什麼都不能導致此?