You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a strange issue. I'm using Lockbox to encrypt my database values for the user model. Lockbox stores the field as {field_name}_ciphertext. Besides encrypting the data, lockbox also provides instance methods with the original {field_name}. I'd expect Rails Admin to be able to display the field, by calling the instance method, but somehow this doesn't work.
# suppose my field is name, this doesn't work
rails_admin do
list do
fields :name
end
end
If I manually create an instance method, that is basically an alias for the instance method Lockbox creates, it does work:
def name_decode
name
end
rails_admin do
list do
fields :name_decode
end
end
Any ideas how I could let Rails Admin call the correct method on the instance?
The text was updated successfully, but these errors were encountered:
What is strange is, when I look at another model, that is related to the User model (that has the name_cipertext encryption), that User model's name is de decyphered value for name. So in relationships it works, but when showing the original record, it doesn't.
I have a strange issue. I'm using Lockbox to encrypt my database values for the user model. Lockbox stores the field as
{field_name}_ciphertext
. Besides encrypting the data, lockbox also provides instance methods with the original{field_name}
. I'd expect Rails Admin to be able to display the field, by calling the instance method, but somehow this doesn't work.If I manually create an instance method, that is basically an alias for the instance method Lockbox creates, it does work:
Any ideas how I could let Rails Admin call the correct method on the instance?
The text was updated successfully, but these errors were encountered: