darkstardevx has quit [Remote host closed the connection]
darkstardevx has joined #ruby
<leftylink>
it's only logical
<leftylink>
saying an obvious falsehood like "it executes a proc in the current context" would quickly get shot down and therefore get the response of what it actually does
eddof13 has joined #ruby
eddof13 has quit [Client Quit]
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ur5us has joined #ruby
cocalero has joined #ruby
ssh0732 has quit [Ping timeout: 258 seconds]
jhass has quit [Ping timeout: 268 seconds]
jetchisel has joined #ruby
jhass has joined #ruby
fercell has joined #ruby
Guimauve has joined #ruby
fercell has quit [Ping timeout: 260 seconds]
taiju has quit [Ping timeout: 268 seconds]
darkstardevx has quit [Read error: Connection reset by peer]
darkstardevx has joined #ruby
cocalero has quit [Quit: Going offline, see ya! (www.adiirc.com)]
eddof13 has joined #ruby
eddof13 has quit [Client Quit]
<leftylink>
though I had to make f take a _ arg because self gets passed to the block... it's a little unergonomic. wonder what I can do about that
<leftylink>
obviously not a problem if I just pass a block
jetchisel has quit [Quit: Unfortunately time is always against us -- [Morpheus]]
<leftylink>
this is such a fruitless idea though. I would never advocate actually doing this. I think at the most if I was going to have something with dynamic scope I would require that all accesses declare that they expect the scope to be dynamic, otherwise you just can't understand the code
<leftylink>
but I think for now we're just exploring what's possible, without regard to whether it's a good idea
<leftylink>
oh and of course another disadvantage is that because it's using method_missing lexically-scoped stuff takes precedence
jpn has joined #ruby
Guest38 has joined #ruby
Guest38 has quit [Client Quit]
<leftylink>
although the alternative doesn't help there! if a variable and a function have the same name the variable wins
<leftylink>
and of course rspec let is dynamically scoped variable
<littlebuddy>
Hi! I have a `Sites` model (subdomain-based multi-tenancy using ActsAsTenant) which has many `Categories` which has many `Posts`.
<littlebuddy>
From my `Posts#index` root route I would like to do `Post.where(site: current_tenant)` except `Post` isn't associated with `Site`, only `Category` is.
<littlebuddy>
Is there a way to do this without having to add `belongs_to :site` to `Post`?
swaggboi has quit [Ping timeout: 244 seconds]
ur5us has quit [Remote host closed the connection]
ur5us has joined #ruby
ur5us has quit [Ping timeout: 250 seconds]
Inoperable has quit [Quit: All your buffer are belong to us!]
swaggboi has joined #ruby
Inoperable has joined #ruby
robotmay has quit [Ping timeout: 268 seconds]
tankf33der has joined #ruby
nirvdrum has joined #ruby
protektwar has joined #ruby
protektwar has quit [Changing host]
protektwar has joined #ruby
skuntee4 has quit [Ping timeout: 260 seconds]
jpn has quit [Ping timeout: 265 seconds]
ur5us has joined #ruby
jpn has joined #ruby
nirvdrum has quit [Quit: nirvdrum]
nirvdrum has joined #ruby
nirvdrum has quit [Ping timeout: 268 seconds]
fercell has joined #ruby
fercell has quit [Ping timeout: 265 seconds]
protektwar has quit [Ping timeout: 250 seconds]
jpn has quit [Ping timeout: 268 seconds]
Rounin has joined #ruby
Sankalp has quit [Ping timeout: 250 seconds]
ruralscientist has quit [Remote host closed the connection]
ruralscientist has joined #ruby
ur5us has quit [Ping timeout: 268 seconds]
jpn has joined #ruby
sylario has joined #ruby
jpn has quit [Ping timeout: 265 seconds]
robotmay has joined #ruby
fercell has joined #ruby
nirvdrum has joined #ruby
nirvdrum has quit [Client Quit]
fercell has quit [Ping timeout: 244 seconds]
dionysus69 has joined #ruby
ruralscientist has quit [Remote host closed the connection]
ruralscientist has joined #ruby
Al2O3 has quit [Ping timeout: 244 seconds]
ruralscientist has quit [Remote host closed the connection]
ruralscientist has joined #ruby
hightower3 has quit [Remote host closed the connection]
nirvdrum has joined #ruby
hightower2 has joined #ruby
teclator has joined #ruby
hightower2 has quit [Remote host closed the connection]
mikecmpbll has quit [Ping timeout: 244 seconds]
mikecmpbll has joined #ruby
jpn has joined #ruby
ruralscientist has quit [Remote host closed the connection]
fercell has joined #ruby
nirvdrum has quit [Quit: nirvdrum]
protektwar has joined #ruby
protektwar has joined #ruby
protektwar has quit [Changing host]
fercell has quit [Ping timeout: 250 seconds]
moldorcoder7 has joined #ruby
hightower2 has joined #ruby
hightower2 has quit [Remote host closed the connection]
hightower2 has joined #ruby
dionysus69 has quit [Ping timeout: 244 seconds]
caleb has quit [Remote host closed the connection]
hwrd has quit [Remote host closed the connection]
g_sg has quit [Remote host closed the connection]
KOTP has quit [Remote host closed the connection]
graemefawcett has quit [Remote host closed the connection]
Bounga has quit [Write error: Broken pipe]
tsujp has quit [Remote host closed the connection]
alexisg has quit [Remote host closed the connection]
matta has quit [Remote host closed the connection]
<rapha>
adam12: half-way through the talk and i'm thinking, wow, this is why i never felt at home in Rails, or even capable of really doing something with it, and what made me get out of web apps entirely.
<rapha>
unfortunately there's a lot of language being used that makes it difficult to understand. will have to do some research of those terms and then watch again.
jpn has quit [Ping timeout: 252 seconds]
Tempesta has quit [Quit: See ya!]
jpn has joined #ruby
Tempesta has joined #ruby
Sankalp has joined #ruby
nirvdrum has joined #ruby
nirvdrum_ has joined #ruby
dionysus69 has joined #ruby
nirvdrum has quit [Ping timeout: 268 seconds]
nirvdrum_ has quit [Quit: nirvdrum_]
nirvdrum has joined #ruby
perdent has joined #ruby
some14u has joined #ruby
nirvdrum has quit [Quit: nirvdrum]
some14u has quit [Ping timeout: 252 seconds]
perdent has quit [Quit: Client closed]
perdent has joined #ruby
nirvdrum has joined #ruby
nirvdrum has quit [Client Quit]
jpn has quit [Ping timeout: 268 seconds]
some14u has joined #ruby
perdent has quit [Quit: Client closed]
some14u has quit [Ping timeout: 268 seconds]
perdent has joined #ruby
jpn has joined #ruby
fercell has joined #ruby
fercell has quit [Ping timeout: 268 seconds]
nirvdrum has joined #ruby
fercell has joined #ruby
John_Ivan has joined #ruby
fercell has quit [Ping timeout: 260 seconds]
gr33n7007h has quit [Quit: WeeChat 3.6]
Rounin has quit [Remote host closed the connection]
gr33n7007h has joined #ruby
nirvdrum has quit [Quit: nirvdrum]
dionysus69 has quit [Ping timeout: 268 seconds]
szkl has joined #ruby
nirvdrum has joined #ruby
dionysus69 has joined #ruby
some14u has joined #ruby
nirvdrum has quit [Quit: nirvdrum]
<littlebuddy>
Hi! I have a `Sites` model (subdomain-based multi-tenancy using https://github.com/ErwinM/acts_as_tenant) which has many `Categories` which has many `Posts`. From my `Posts#index` root route I would like to do `Post.where(site: current_tenant)` except `Post` isn't associated with `Site`, only `Category` is. Is there a way to do this without having to add `belongs_to :site` to `Post`? Otherwise all my
<littlebuddy>
separate multisites will share the same content :(
Laplace has joined #ruby
<Laplace>
Hey folks -- How can I 'override' a method in Ruby while providing a different method to call it? For example, how do I change the behaviour of `to_s` while still providing `old_to_s`
<Laplace>
I want to override `to_s` for a class, while still providing an escape hatch to use the "regular behaviour"
nirvdrum has joined #ruby
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Laplace>
I think I have a solution. I think what I'll do is just call super_method to_s
TomyWork has joined #ruby
dorian has quit [Ping timeout: 268 seconds]
some14u has joined #ruby
some14u has quit [Client Quit]
protektwar has quit [Ping timeout: 268 seconds]
<adam12>
Laplace: alias_method or alis
<adam12>
err, alias
<adam12>
alias_method :original_to_s, :to_s
<adam12>
littlebuddy: Can you use a has_many through? It's been a while since I've done Rails.
<adam12>
rapha: Using doctrine of useful objects has been one of the better things I've adopted in recent memory. It makes a crazy amount of sense, tho there is some boilerplate that you have to do.
<littlebuddy>
adam12: Looks like it, yep!
nirvdrum has quit [Quit: nirvdrum]
Al2O3 has quit [Ping timeout: 255 seconds]
nirvdrum has joined #ruby
nirvdrum has quit [Client Quit]
<rapha>
adam12: yes, he talks about that, too, like, the boilerplate fallacy where people come to expect, "oh, has_many :somethings, just one line of code, how simple", but it's actually not. i don't know your background but i haven't formally studied CS or anything, so there's a lot of mental concepts they seem to be building upon, so for me this has so far been a bit of a journey down the proverbial rabbit
<rapha>
hole ... exciting though, feeling a bit like alice.
nirvdrum has joined #ruby
Al2O3 has joined #ruby
<adam12>
rapha: Lately I've preferred boilerplate over not. If I reach for a gem, I generally regret it because it might churn and cause work for me. So typing it out has been nice. And juniors understand it more.
<adam12>
ie. for Doctrine of Usable Objects, you might end up with a similar `self.configure` method in every object. `instance = new; receiver.some_method = instance`. And you can automate that out, but it's kind of nice just having it there in plain view.
<adam12>
Many classes have a super similar `configure` method. And I've thought about "DRYing" it up, but I just can't forgive the simplicity of it.
nirvdrum has joined #ruby
* rapha
takes a peek not knowing much about DNS or clouds other than that they're beautiful when made of water vapor
<rapha>
hmm ok
<rapha>
i'll keep that open while watching the video again next time
<adam12>
LOL. This example is simple; it just makes calls using Faraday. But I inject the conn (Faraday connection) as a dependency since Faraday supports mocks and I can inject a Mocked conn too.
<adam12>
It's kind of similar to James Shore's Nullable Infrastructure, or testing without mocks.
<rapha>
see that's that thing with the terminology
<rapha>
i can infer that Faraday must be another piece of software from the uppercase R
<rapha>
F i mean
<rapha>
but then "mocks" and "inject" and "Mocked", wow, now it's going over the top of my head again
<rapha>
same as with the Doctrine videos
<rapha>
need to go slow with this but it has a very interesting flavour to it
<adam12>
rapha: Ah, sorry. Faraday is an HTTP client wrapper for Ruby that's been around a long time.
nirvdrum has quit [Client Quit]
<rapha>
and by mock you mean "not real just made-up"?
some14u has joined #ruby
some14u has quit [Client Quit]
<adam12>
rapha: Right. It's not _really_ a HTTP client, but it looks like one, and might act like one all the way up to making the HTTP request to the Internet. But then it might return a fake response as if it did.
<rapha>
okay
<rapha>
that's nice for webscraping without bothering admins
<rapha>
like, while you still work on it :)
<adam12>
rapha: Yeah! When I've done that in the past, I might `wget -m` to get a local copy of part of the site, then point my scraper at that while i debug it. Maybe only a few pages.
nirvdrum has joined #ruby
nirvdrum has quit [Quit: nirvdrum]
nirvdrum has joined #ruby
fercell has joined #ruby
Inoperable has quit [Excess Flood]
fercell has quit [Ping timeout: 252 seconds]
Inoperable has joined #ruby
some14u has joined #ruby
some14u has quit [Client Quit]
eddof13 has joined #ruby
mikecmpbll has quit [Read error: Connection reset by peer]
sgt_chuckles has joined #ruby
mikecmpbll has joined #ruby
<sgt_chuckles>
i have some rspec trests that run in circleci job to check acceptance criteria for files in a certain folder, but don't want them to run if no changes are detected in the folder.
<sgt_chuckles>
is there a way to make a spec pass automatically on a condition, skipping all other tests?
some14u has joined #ruby
some14u has quit [Client Quit]
nirvdrum has quit [Quit: nirvdrum]
Laplace has quit [Quit: Connection closed for inactivity]
fercell has joined #ruby
some14u has joined #ruby
fercell has quit [Ping timeout: 264 seconds]
moldorcoder7 has quit [Quit: %bye mirc%]
protektwar has joined #ruby
protektwar has quit [Changing host]
protektwar has joined #ruby
moldorcoder7 has joined #ruby
jpn has quit [Quit: Lost terminal]
some14u has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
_ht has joined #ruby
TomyWork has quit [Quit: Leaving]
<adam12>
sgt_chuckles: What about wrapping them all in a giant if statement?
<adam12>
sgt_chuckles: rspec supports `:if => condition`, so could look at that too.