Error on Proposals

Hi,
I had install consul in my server, but when i try to use proposals and navigate to the section i see the next error:

NoMethodError in Proposals#index

Showing /home/consul/app/views/proposals/_proposal.html.erb where line #31 raised:

undefined method `hidden?’ for nil:NilClass

Extracted source (around line #31):

          <%= l proposal.created_at.to_date %>

          <% if proposal.author.hidden? || proposal.author.erased? %>
            <span class="bullet">&nbsp;&bull;&nbsp;</span>
            <span class="author">
              <%= t("proposals.show.author_deleted") %>

Im noob in ruby, so please, can anyone help me?
Thanks

edit: this is in case you get a 500 (i think) error when entering the proposals tab, you you have a different error then this might not help you

i recomend you use this link, i had the same problem but i fixed it with help in this thread https://consul.slack.com/archives/C5YSVBLSY/p1581402272017800
first you need to find the proposal that is making the ( i think it was a 500 error) appear by going directly into the link in example yourdomain. com/proposals/1 no error then go to yourdomain. com/proposals/2 if lets say the proposal 2 has the error you need to add an author id to that proposal with sql.
WITH THIS COMMANDS YOU CAN ENTER INTO SQL MODE TO EDIT THE TABLES ONCE YOU ARE ON A SSH CONNECTION OR DIRECTLY USING YOUR SERVER
**root@ubuntu~$** sudo -i -u postgres with the user ‘postgres’
**postgres@Ubuntu~$** psql
**postgres=#** \c consul_production normally the name of the database
con**sul_production=#** \dt this lists all available tables
**consul_production=#** select * from users; this shows all of the users
**consul_production=#** update users set username = 'Mickey Mouse' where id=3; example to alter a data entry
**consul_production=#** \q how to leave psql
you need to edit the proposals table i think and add an author_id (preferably yours so you can delete the proposal once you can see it again) to the proposal_id that gives you the (500) error, the command will be (once you are on the proposals table) UPDATE TABLE proposals, SET author_id=“1” WHERE proposal_id=“2”
the command may not be 100% fine as i dont remember what the column names are, you can get your user id by going into my content on your webpage and the proposal id by going one link at a time as i said before (you might find it by selecting * from proposals where proposal_id=null or “” im not sure how you would do it as i found it the hard way, if you have problems go into the link i posted and ask there.
NOTE: DONT TAKE MY SQL COMMANDS AS FACT, I DONT REMEMBER THE COLUMNS AND I MIGHT HAVE MADE A MISTAKE WRITING A COMMAND, I SUGGEST ASKING SOMEONE WHO KNOWS SQL FOR HELP, THE FIRST COMMANDS, ALSO NEVER FORGET TO ADD THE “WHERE” TO THE SQL COMMANDS OR YOU WILL CHANGE THE AUTHOR_ID TO EVERY PROPOSAL AND YOU WONT BE ABLE TO GO BACK

1 Like