【发布时间】:2016-09-27 19:46:03
【问题描述】:
我有以下固定装置。
users.yml
first_user:
name: User1
password_hash: <%= BCrypt::Engine.hash_secret('password', '$2a$10$xKPXy2QabH6ThBjo7gNB8O') %>
password_salt: $2a$10$xKPXy2QabH6ThBjo7gNB8O
role: 1
stores.yml
one:
name: MyFirstString
user_id: <%= ActiveRecord::FixtureSet.identify(:first_user) %>
但是,当我加载Store.first.user_id 时,我得到的值为979462526,而User.first.id 是980190962。我认为这些值不应该不同。请纠正我的理解或指出我的代码中的错误(如果有)。模型结构是:一个用户有很多店铺。
【问题讨论】:
-
显然等于 979462526。
标签: ruby-on-rails ruby fixtures