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
<FromGitter> <Uzay-G> @drujensen do I just set the production key to a random hash?
_whitelogger has joined #amber
raz has quit [Ping timeout: 260 seconds]
raz has joined #amber
raz has quit [Changing host]
raz has joined #amber
raz has quit [Ping timeout: 264 seconds]
raz has joined #amber
raz has quit [Changing host]
raz has joined #amber
<FromGitter> <Serdnad> @rnice01 not super elegant, but I'm using `#all` with a handwritten query to perform a JOIN. An example from the docs: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/amberframework/amber?at=5ec80a60b101510b200eaf62]
<FromGitter> <Blacksmoke16> why not just setup a relationship?
<FromGitter> <drujensen> @Uzay-G A production key in `.encryption_key` should have been created for you when you created the project
<FromGitter> <Uzay-G> i don't have any. Is there a way I can generate a new one?
<FromGitter> <Serdnad> how would the above query look if I had a relationship set up?
<FromGitter> <drujensen> i think if you create a `/config/envrionments/production.yml and delete the `/config/environments/.production.enc` and `.encryption_key` file, it will create a new one for you
<FromGitter> <drujensen> you will want to copy development.yml to production.yml and update accordingly
<FromGitter> <Uzay-G> it doesn't generate a new one
<FromGitter> <drujensen> hhmm
<FromGitter> <Uzay-G> how would that work though? it would have to listen to when I create the file
raz has quit [Ping timeout: 260 seconds]
raz has joined #amber
raz has joined #amber
raz has quit [Changing host]
<FromGitter> <rnice01> Hey thanks for the reply, so I did try that but it doesn't seem to be working for me. I have this in my controller
<FromGitter> <rnice01> ``````
<FromGitter> <rnice01> But my logs show that it's still querying for the individual `vehicle_type` when I access the attribute in my view
raz has quit [Ping timeout: 260 seconds]
<FromGitter> <drujensen> @Uzay-G first generate a secure random number. you can do this using `amber x “UUID.random"`
<FromGitter> <drujensen> create a `.encryption_key` and place the secure random uuid in that file
raz has joined #amber
raz has quit [Changing host]
raz has joined #amber
<FromGitter> <drujensen> `cp config/environments/development.yml config/environments/production.yml`
<FromGitter> <drujensen> then run `amber encrypt` twice
<FromGitter> <drujensen> the first time will convert the `production.yml` to `.production.enc`
<FromGitter> <drujensen> the second time unencrypt and will open the file for you to edit
<FromGitter> <Uzay-G> do u know if the amber heroku buildpack generates the config for you?
<FromGitter> <Uzay-G> i don't want to mess up the config
<FromGitter> <drujensen> i’m kinda confused
<FromGitter> <Uzay-G> basically i have never edited my production config and i think the buildpack has handled it for me
<FromGitter> <drujensen> if you don’t have the encryption key, then you can’t open the `.production.enc`
<FromGitter> <Uzay-G> yeah i know
<FromGitter> <drujensen> sooo…do you have it or not?
<FromGitter> <Uzay-G> no
<FromGitter> <drujensen> then i don’t know how the build pack would be able to open it
<FromGitter> <drujensen> it would need the key
<FromGitter> <Uzay-G> no i think the buildpack just took care of generating its own config
<FromGitter> <Uzay-G> i have never set any of the config for production
<FromGitter> <drujensen> Did you set an environment variable?
<FromGitter> <drujensen> AMBER_ENCRYPTION_KEY
<FromGitter> <Uzay-G> nope
<FromGitter> <drujensen> it is either that or the .encryption_key file
<FromGitter> <drujensen> hhmm, so not sure how it would be able to open that file
<FromGitter> <drujensen> I’m not familiar with the build pack
<FromGitter> <Uzay-G> i think it doesnt open the file. It connects to heroku to set the db url, etc... and then generates the config file. I mean im not sure how it works either
<FromGitter> <Serdnad> huh, interesting... I'm gonna have to check my logs now. I don't actually use Amber, just the ORM Granite.
raz has quit [Ping timeout: 256 seconds]
raz has joined #amber
raz has quit [Changing host]
raz has joined #amber
<FromGitter> <drujensen> I’m not seeing how this query will preload all vehicle types for all vehicles and avoid the N+1. The only way would be querying both vehicles and vehicle types in one query and then populating both models from that result set.
<FromGitter> <Serdnad> ah, that makes sense... guess my SQL is lacking, sorry to have misled
<FromGitter> <drujensen> its all good. love to see the community working together to solve problems
raz has quit [Ping timeout: 272 seconds]
raz has joined #amber
raz has quit [Changing host]
raz has joined #amber
raz has quit [Ping timeout: 256 seconds]
raz has joined #amber
raz has joined #amber
raz has quit [Changing host]
raz has quit [Ping timeout: 256 seconds]
raz has joined #amber
raz has quit [Changing host]
raz has joined #amber
<FromGitter> <rnice01> Yeah I'd love to help with adding a preloading type feature to Granite but I know next to nothing about ORMs. Maybe I should see how other Crystal ORM providers are handling that...
raz has quit [Ping timeout: 246 seconds]
raz has joined #amber
raz has joined #amber
raz has quit [Changing host]
raz has quit [Ping timeout: 256 seconds]
raz has joined #amber
raz has quit [Changing host]
raz has joined #amber