[ANN] rails_best_practices 0.9.0 released

flyerhzm Posted by flyerhzm on May 15, 2011

Comments

I just released rails_best_practices 0.9.0, the changes as follows:

1. add "remove empty helpers" check, http://rails-bestpractices.com/posts/72-remove-empty-helpers

2. add Core::Mailers to collect mailers' names in prepare process

3. remove explicit version dependencies in gemspec.

Check it here: https://github.com/flyerhzm/rails_best_practices

[ANN] rails_best_practices 0.8.0 released

flyerhzm Posted by flyerhzm on April 23, 2011

Comments

I just released rails_best_practices 0.8.0, the changes as follows:

1. add simplify render in views check, http://rails-bestpractices.com/posts/61-simplify-render-in-views

2. add simplify render in controllers check, http://rails-bestpractices.com/posts/62-simplify-render-in-controllers

3. rescue the Haml::Error to ignore haml custom filter

4. return empty array if prepare stuff are nil, e.g. Prepares.model_attributes or Prepares.

Check it here: https://github.com/flyerhzm/rails_best_practices

[ANN] rails_best_practices 0.7.4 released

flyerhzm Posted by flyerhzm on March 25, 2011

Comments

I just released rails_best_practices 0.7.4, it brings a new prepare, named SchemaPrepare.

What SchemaPrepare does is scanning the schema.rb file to remember all the model attributes. It makes law_of_demeter_review and use_query_attribute_review more accurate.

1. law_of_demeter_review

E.g. post.user.name, before I just check if the user is an association of post and there is a method call on user, then it violdates the law of demeter, but it is not accurate. Now I check if the user is an association of post and the name is the attribute of user, then it violates the law of demeter.

2. use_query_attribute_review

E.g user.login.blank?, before I just check if the login is not the association of user and login is not pluralize, then it violates the use query attribute. Now with model attributes, it becomes more accurate and easier, I check if login is the attribute of user instead. And in practice, it won't tell you to use query attribute on number attribute.

Check it here: https://github.com/flyerhzm/rails_best_practices

[ANN] rails_best_practices 0.7.3 released

flyerhzm Posted by flyerhzm on March 23, 2011

Comments

I just released rails_best_practices 0.7.3, it's just a bug fixed version.

In 0.7.2, I began to parse the option :class_name => 'Model' for has_many and other association keyword, I used eval to parse the options which cause the error

https://github.com/flyerhzm/rails_best_practices/issues/42

Ad the sexp of options looks like s(:hash, s(:lit, :class_name), s(:str, "IssueCategory"), s(:lit, :foreign_key), s(:str, "category_id")), so the element next to s(:lit, :class_name) is what I need, so I don't need eval anymore.

[ANN] rails_best_practices 0.7.2 released

flyerhzm Posted by flyerhzm on March 17, 2011

Comments

I just released rails_best_practices 0.7.2, the changes are as follows:

1. The UseMultipartAlternativeAsContentTypeOfEmailReview doesn't warn if a mailer only has a plain text template.

2. Fix the wrong warning of UseSayWithTimeInMigrationsReview  when say_with_time is called in the iteration block.

3. Don't hack Nil class anymore, it annoyed some guys, use RailsBestPractices::Core::Nil class instead. (This may cause some parsing errors, please add issues on github if you meet them.)

4. Allow to write your own check list, it's really interesting, I believe you will like it. I wrote an example on the wikis to teach you how to do, https://github.com/flyerhzm/rails_best_practices/wiki/How-to-write-your-own-check-list.

Check it here: https://github.com/flyerhzm/rails_best_practices.