Search Mailing List Archives

Limit search to: Subject & Body Subject Author
Sort by: Reverse Sort
Limit to: All This Week Last Week This Month Last Month
Select Date Range     through    

[bioontology-support] Editing models

Michael Dorf mdorf at
Thu Mar 10 11:28:27 PST 2016

Hi Vincent,

Here is the correct way of doing this:

pry(main)> user = LinkedData::Models::User.where(username: 'admin').first
pry(main)> user.bring_remaining
pry(main)> user.password="hello12345"
pry(main)> user.valid?

Hope this helps!


On Mar 10, 2016, at 06:32, Vincent Emonet <vincent.emonet at<mailto:vincent.emonet at>> wrote:


I am trying to edit a User to change its password (to quickly change the "admin" password without having to send a reset email and all)

It seems that it can be done easily using the "password=" method of LinkedData::Models::User


  *   Using the VA console:

bin/ncbo_cron --console

  *   Trying to change the user fails:

pry(main)> user = LinkedData::Models::User.find("admin")

This command is working fine and returning
=> #<LinkedData::Models::User:0x007f37437a7660
 @email="admin at"<mailto:admin at>,
 @loaded_attributes=#<Set: {:username, :email, :passwordHash}>,
 @modified_attributes=#<Set: {}>,

But if I directly call back user I got errors (related to existence of attributes):

pry(main)> user
=> #<LinkedData::Models::User:0x007f3744fe99f8
  {:username=>{:existence=>"`username` value cannot be nil"},
   :email=>{:existence=>"`email` value cannot be nil"},
   :passwordHash=>{:existence=>"`passwordHash` value cannot be nil"}},
 @loaded_attributes=#<Set: {:lastName, :username}>,
 @modified_attributes=#<Set: {:lastName}>,
[47] pry(main)>

This is preventing me from doing "user.valid?" and ""

Why are username, email and passwordHash considered as nil when I call back user (we can see their values when we call it the first time)? Seems like the object isn't consistent.

Have a good day,

Vincent Emonet

bioontology-support mailing list
bioontology-support at<mailto:bioontology-support at>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the bioontology-support mailing list