faustinoaq changed the topic of #amber to: Welcome to Amber Framework community! | https://amberframework.org | Developer happiness, productivity and bare metal performance | GH: https://github.com/amberframework | Docs: https://docs.amberframework.org | Gitter: https://gitter.im/amberframework/amber | IRC Logger: https://irclog.whitequark.org/amber | Amber::Server.start
_whitelogger has joined #amber
_whitelogger has joined #amber
_whitelogger has joined #amber
<FromGitter> <Uzay-G> Is there a way to do something like this:
<FromGitter> <Uzay-G> `activity = Activity.where(:created_at, :gt, Time.utc.at_beginning_of_day, bot_id: bot.id)`
<FromGitter> <Uzay-G> I am comparing with the greater than operator but also checking for bot id
<FromGitter> <Uzay-G> is that possible?
<FromGitter> <Blacksmoke16> prob, id just try it
<FromGitter> <Uzay-G> yeah i did
<FromGitter> <Uzay-G> doesn't work
<FromGitter> <Blacksmoke16> doesnt work how
<FromGitter> <Uzay-G> ```code paste, see link``` [https://gitter.im/amberframework/amber?at=5ebd53abe36f1840e561a1e4]
<FromGitter> <Uzay-G> It works when I remove the `bot_id` part
<FromGitter> <drujensen> try `Activity.where(:created_at, :gt, Time.utc.at_beginning_of_day).where(bot_id: bot.id)
<FromGitter> <Uzay-G> yeah I had tried that but it leads me to another error 😄
<FromGitter> <Uzay-G> when I do that I can't access the elements in the array with `[]`
<FromGitter> <Uzay-G> `Error: undefined method '[]' for Granite::Query::Builder(Activity)`
<FromGitter> <Uzay-G> or with `first`: `Error: undefined method 'first' for Granite::Query::Builder(Activity)`
<FromGitter> <Blacksmoke16> add a `.select`
<FromGitter> <Blacksmoke16> to actually execute the query
<FromGitter> <Uzay-G> so like this:
<FromGitter> <Uzay-G> `Activity.where(:created_at, :gt, Time.utc.at_beginning_of_day).where(bot_id: bot.id).select.first`
<FromGitter> <Blacksmoke16> yea
<FromGitter> <Uzay-G> ok thanks
<FromGitter> <Blacksmoke16> *might* be able to just do `.first`
<FromGitter> <Uzay-G> no u can't
<FromGitter> <Blacksmoke16> ah rip
<FromGitter> <Blacksmoke16> ok
<FromGitter> <Uzay-G> how does js work with amber?
<FromGitter> <Uzay-G> like if I create a new js file and import some modules in it, how can i use it
<FromGitter> <Blacksmoke16> :shrug:
<FromGitter> <damianham> @Uzay-G using JS with Amber is very straight forward, just import your JS files into src/assets/javascripts/main.js, and webpack will load them into the public/dist/main.bundle.js file. Are you creating React components ? then just load them into the DOM on the DOMContentLoaded event. Easy
<FromGitter> <Uzay-G> ok thanks 👍