#help

Resolving NoMethodError in Ruby Code

TLDR justman10000 encountered a NoMethodError in their code. After a detailed discussion with quadral and sojan_official, they managed to resolve the issue.

Powered by Struct AI
24
4mo
Solved
Join the chat
Jul 30, 2023 (4 months ago)
justman10000
Photo of md5-56b2790c5f5ac3b8b1b26e2d345fee29
justman10000
01:09 PM
Got with this code:

ruby
def save_as_new_config(latest)
  config = InstallationConfig.find_or_initialize_by(name: latest[:name])
  config.value = latest[:value]
> config.locked = latest[:locked]
  config.save!
end


this error:

NoMethodError: undefined method `locked='
Needle
Photo of md5-b3c47994ac990a44a1e2af0a47d56daa
Needle
01:09 PM
Please add any additional information to this thread. The team will follow up.
justman10000
Photo of md5-56b2790c5f5ac3b8b1b26e2d345fee29
justman10000
01:18 PM
@217473672833662977@443098869891596288@492415268069441536@197082982379421696
01:18
justman10000
01:18 PM
Any of you have any ideas?
01:18
justman10000
01:18 PM
🤔
quadral
Photo of md5-1b3d91e1c19b1e6f80131047f1c3e4ae
quadral
05:25 PM
how do you replicate this
05:25
quadral
05:25 PM
justman10000
justman10000
Photo of md5-56b2790c5f5ac3b8b1b26e2d345fee29
justman10000
05:40 PM
Compile via source code
quadral
Photo of md5-1b3d91e1c19b1e6f80131047f1c3e4ae
quadral
05:42 PM
yes but what are the steps to replicate this
06:51
quadral
06:51 PM
I think enabling pgcrypto is what is causing your problem
justman10000
Photo of md5-56b2790c5f5ac3b8b1b26e2d345fee29
justman10000
07:18 PM
pgcrypto must be activating to compile Chatwoot
quadral
Photo of md5-1b3d91e1c19b1e6f80131047f1c3e4ae
quadral
07:55 PM
any reason why are u installing from source? isnt there repos for this
Jul 31, 2023 (4 months ago)
justman10000
Photo of md5-56b2790c5f5ac3b8b1b26e2d345fee29
justman10000
02:13 PM
It exits the Docker image, yes...
02:14
justman10000
02:14 PM
But it's too easy for me, and I can check the functionality of my PRs this way
Aug 01, 2023 (4 months ago)
justman10000
Photo of md5-56b2790c5f5ac3b8b1b26e2d345fee29
justman10000
10:59 PM
😒
11:07
justman10000
11:07 PM
But thanks anyway
11:07
justman10000
11:07 PM
🙂
11:48
justman10000
11:48 PM
sojan_official
11:48
justman10000
11:48 PM
Can anything work?
11:48
justman10000
11:48 PM
Image 1 for
Aug 02, 2023 (4 months ago)
justman10000
Photo of md5-56b2790c5f5ac3b8b1b26e2d345fee29
justman10000
06:22 PM
Really?
06:23
justman10000
06:23 PM
Image 1 for
08:18
justman10000
08:18 PM
All good, got it right