Scope `funk` doesn't match on Class methods - ruby
See original GitHub issueI was hoping to try and fix this myself as a way to get familiar with how cursorless + tree sitter works but it might take me a bit to get up to speed. Here is the issue:
Given this code:
class Test
class << self
# `take funk` doesn't work
def baz
end
end
# `take funk` doesn't work
def self.foo
new.process
end
# `take funk` doesn't work
def Test.bar
new.process
end
# `take funk` works :D
def process
puts "process"
end
end
Current use cases/scopes not covered:
-
"change funk"
on a function definedself.
-
"change funk"
on a function definedClassName.
-
"change funk"
on a function defined withinclass << self .... end
block
Issue Analytics
- State:
- Created a year ago
- Comments:17 (12 by maintainers)
Top Results From Across the Web
Should you use scopes or class methods? - Justin Weiss
When your scope logic gets complicated, a class method feels like the right place to put it. Inside a class method, you can...
Read more >ActiveRecord Rails 3 scope vs class method - Stack Overflow
From what I can gather, a scope is always expected to return a relation, whereas a class method doesn't necessarily have to. Is...
Read more >Hunting Down the Scoop on ActiveRecord Scopes
We tried to call the order method on a falsy object (aka nil ). Obviously Ruby is unhappy, because it looks like Review.published(nil)...
Read more >Upgrading Ruby on Rails
Upgrading Ruby on RailsThis guide provides steps to be followed when you upgrade your applications to a newer version of Ruby on Rails....
Read more >README — Documentation for pundit (2.0.1) - RubyDoc.info
In your controller, Pundit will call the current_user method to retrieve what to ... class PostPolicy < ApplicationPolicy def update? user.admin? or not...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Heyo @richardmcmillen, interjecting here. I’m Will Sommers on the Talon slack and wheels on Handsfree Discord. Reach out if you have questions. I’m happy to answer there as well if it helps with a quicker feedback loop!
Heyo @richardmcmillen — thanks for adding this and apologies for missing it initially. I added another example in your code example and added a check list. When recording a test, it is best to use
change
orchuck
instead oftake
since it is easier to see what happened in the test example. Please reach out in Slack if you have any questions or run into problems trying to implement this.@pokey, no idea what to call whatever is inside
class << self
, thoughts?