I am using the audited gem for tracking changes to a record. An audit object looks like
id: 1,
auditable_id: 1,
auditable_type: "Customer",
associated_id: nil,
associated_type: nil,
user_id: nil,
user_type: nil,
username: nil,
action: "create",
audited_changes:
{"first_name"=>"Milan McClure",
"last_name"=>"Wilfred Carter IV",
"email"=>"brian.hahn@vonrueden.com",
"sms_optin"=>true,
"title"=>nil,
"is_deleted"=>false,
"deleted_at"=>nil,
"restored_at"=>nil},
version: 1,
comment: nil,
remote_address: nil,
request_uuid: "6e462bf8-4788-4ec5-a6ee-f31a7a8226d0",
created_at: Wed, 12 Apr 2017 12:20:39 UTC +00:00>,
and so on. Now i want to filter out only those audits where audit.audited_changes which is a hash in the audited object includes a change in first name. How can i query this one?