If you view the query, @bot_client_id is a string with the same value of string. However, I get different results when using them as part of my query.
Why?
[24] pry(#<BotResponse>):1> string
=> "aiaas-1409611358153-user-0149"
[25] pry(#<BotResponse>):1> @bot_client_id
=> "aiaas-1409611358153-user-0149"
[26] pry(#<BotResponse>):1> Event.where.has{(status == 'active') & (bot_client_id == @bot_client_id)}
=> []
[27] pry(#<BotResponse>):1> Event.where.has{(status == 'active') & (bot_client_id == string)}
=> [#<Event:0x0000000464d120
id: 22,
bot_client_id: "aiaas-1409611358153-user-0149",
keyword: "gratitude",
topic: nil,
status: "active",
channel: "telegram",
created_date: 2017-05-09 15:56:51 UTC,
tickle_expression: "daily",
time_of_day: "7:00 am",
next_occurrence: 2017-05-14 14:00:00 UTC,
time_zone: "America/Los_Angeles",
recurring: true>,
#<Event:0x0000000464cfb8
id: 23,
bot_client_id: "aiaas-1409611358153-user-0149",
keyword: "daily_check",
topic: nil,
status: "active",
channel: "telegram",
created_date: 2017-05-10 04:25:47 UTC,
tickle_expression: "daily",
time_of_day: "9:00 am",
next_occurrence: 2017-05-14 16:00:00 UTC,
time_zone: "America/Los_Angeles",
recurring: false>]
@bot_client_id.classreturn? I ask because that@bot_client_idreturns a string in the console, does not necessarily mean that it is a string. It'sinspectorto_smethod might just be overridden..hasmethod? Is it from activerecord or some additional library?