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

Vincent Emonet vincent.emonet at
Thu Mar 10 06:32:16 PST 2016


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 

  * 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
>  @aggregates=nil,
>  @email="admin at",
>  @id=#<RDF::URI:0x3f9ba2538acc(>,
>  @loaded_attributes=#<Set: {:username, :email, :passwordHash}>,
>  @modified_attributes=#<Set: {}>,
>  @passwordHash="$2a$10$EHPrU.dR9cmWRq4M5G6W4eIOZGtHCdRjzJMhZaux8lHFz5fP.SlLq",
>  @persistent=true,
>  @previous_values=nil,
>  @unmapped=nil,
>  @username="admin">

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

pry(main)> user
> => #<LinkedData::Models::User:0x007f3744fe99f8
>  @aggregates=nil,
>  @errors=
>   {:username=>{:existence=>"`username` value cannot be nil"},
>    :email=>{:existence=>"`email` value cannot be nil"},
>    :passwordHash=>{:existence=>"`passwordHash` value cannot be nil"}},
>  @id=#<RDF::URI:0x3f9ba2538acc(>,
>  @lastName="teest",
>  @loaded_attributes=#<Set: {:lastName, :username}>,
>  @modified_attributes=#<Set: {:lastName}>,
>  @persistent=true,
>  @previous_values=nil,
>  @unmapped=nil>
> [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

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

More information about the bioontology-support mailing list