Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parse calls to attribute #23

Open
boardfish opened this issue Oct 11, 2021 · 2 comments
Open

Parse calls to attribute #23

boardfish opened this issue Oct 11, 2021 · 2 comments

Comments

@boardfish
Copy link

Calling attribute within a class that inherits from ActiveRecord::Base lets you override the types defined in db/schema.rb, or define transient attributes (attributes stored on instances that aren't saved back to the database). The same API is also usable under Active Model. It'd be really good if solargraph-rails could support this.

@iftheshoefritz
Copy link
Owner

Interesting, I've never seen that before, but I guess if we ignore those calls we're giving bad results when they change the type etc.

Thanks for raising!

@alisnic
Copy link
Collaborator

alisnic commented Aug 23, 2022

@boardfish this now can be easily implemented. Take a look at https://github.com/iftheshoefritz/solargraph-rails/blob/main/lib/solargraph/rails/delegate.rb as an example. Its test should be more telling https://github.com/iftheshoefritz/solargraph-rails/blob/main/spec/solargraph-rails/delegate_spec.rb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants