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
snsei__ has quit [Ping timeout: 276 seconds]
snsei__ has joined #amber
_whitelogger has joined #amber
snsei_ has joined #amber
snsei__ has quit [Ping timeout: 252 seconds]
snsei_ has quit [Remote host closed the connection]
feepbot has quit [Ping timeout: 245 seconds]
feepbot has joined #amber
feepbot has quit [Read error: Connection reset by peer]
feepbot has joined #amber
wantansoup has joined #amber
wantansoup has quit [Client Quit]
<FromGitter> <PlayLights_twitter> Hello there!
<FromGitter> <PlayLights_twitter> Is there any way to change the adapter of a instance on run time?
<FromGitter> <Blacksmoke16> What's the use case?
<FromGitter> <PlayLights_twitter> I mean, I have two different DB url's, one for reading and one for writing, so when I want to write I have to change the adapter
<FromGitter> <Blacksmoke16> hmm
<FromGitter> <Blacksmoke16> it would have to be a feature request
<FromGitter> <Blacksmoke16> but you could prob monkey patch it
<FromGitter> <PlayLights_twitter> My initial approach was having a separate models, but I don't know how to pass from one to another class and also updating both would be a problem
<FromGitter> <Blacksmoke16> basically all the `adapter` macro does is set a class var
<FromGitter> <PlayLights_twitter> actually I was looking at the code on the repository to see where should do it
<FromGitter> <PlayLights_twitter> so the answer would be ⏎ ⏎ ```def self.adapter=(adapter) ⏎ @@adapter = adapter ⏎ end``` ⏎ ⏎ ? [https://gitter.im/amberframework/amber?at=5d1bdd925ce02535b00f2189]
<FromGitter> <Blacksmoke16> well the setter is already defined
<FromGitter> <Blacksmoke16> would just have to do like `Model.adapter = xx`
<FromGitter> <PlayLights_twitter> But that changes the adapter for all object instances? I mean I just wanted to change it for a specific model
<FromGitter> <PlayLights_twitter> specific instance model
<FromGitter> <Blacksmoke16> make an issue about this
<FromGitter> <Blacksmoke16> i think it wouldnt be a bad feature to have
<FromGitter> <Blacksmoke16> but would want to think about the design more
<FromGitter> <PlayLights_twitter> Sure @Blacksmoke16 thanks
<FromGitter> <Blacksmoke16> np
<FromGitter> <Blacksmoke16> like support slave/master database connections
<FromGitter> <PlayLights_twitter> Done, but I'm going to look at it for a temporal way to do it since I have heavy traffic and I need to speed up the db actions
<FromGitter> <Blacksmoke16> Let me think about it
<FromGitter> <Blacksmoke16> Might be able to do this
<FromGitter> <Blacksmoke16> what happens if you do like
<FromGitter> <Blacksmoke16> ```code paste, see link``` [https://gitter.im/amberframework/amber?at=5d1be3d9dd5b167204e140f6]
<FromGitter> <Blacksmoke16> does it print that when you doing select queries?