0 votes
in Ruby by

What part of the code below causes the method #decrypt_data to be run?

class MyModel < ApplicationRecord

after_find :decrypt_data

end

a. MyModel.first.update(field: 'example')

b. MyModel.where(id: 42)

c. MyModel.first.destroy

d. MyModel.new(field: 'new instance')

1 Answer

0 votes
by

What part of the code below causes the method #decrypt_data to be run?

class MyModel < ApplicationRecord

after_find :decrypt_data

end

Correct answer is :-  MyModel.where(id: 42)

...