Announce: Rails Model Schema


#1

I created a package (my first one) called Rails Model Schema that it’s suited for Ruby on Rails development. It displays the information of the table related from a rails model file from the schema.rb file. It works like this:

I wanted to share it with the community of Rails people who uses Atom as i used it for a while and found it a useful and fast alternative to search on the schema.rb file or adding desynchronizable comments to the top of that ruby class.


#2

I like it! I wonder if this could be easily adapted to Phoenix for Elixir …


#3

It depends. I really haven’t worked with phoenix so i don’t know how phoenix it should work. This package is implemented in a really straightforward way and thought for the ruby on rails typical process. It’s done with regexps right now. In the beginning, my inner super-correct programmer wanted to get the ruby AST of the schema.rb and play with it to get the schema.rb information from the method calls but finished just using a set of regexps mostly because i didn’t find a ruby parser in js and because the performance hit the parsing process would create scared me a bit.

I think that, with a couple of time, a refactoring process (to loose the coupling with the search for ruby files and the schema.rb regexp search) and enough knowledge of how phoenix schema works, this can be done.

(Oh, and excuse my english, i’m not a native speaker)


#4

dude, that’s badass


#5

Wow, congratulations!. I really like it :smile:.

I worked with Ripper for my package, which could help you with parsing (if you want to go someday by this way):

Anyway, I get your points. It wasn’t easy and it isn’t cheap from the performance point of view.

Congratulations again!