rails_best_practices

https://github.com/flyerhzm/rails_best_practices

Ruby

a code metric tool for rails projects

RailsBestPractices::Reviews::AddModelVirtualAttributeReview#call_assignment

check a call node with message "save" or "save!",
if there exists an attribute assignment for the receiver of this call node,
and if the arguments of this attribute assignments has duplicated entries (different message and same arguments),
then this node needs to add a virtual attribute.

Source | Google | Stack overflow

Edit

git clone [email protected]:flyerhzm/rails_best_practices.git

cd rails_best_practices

open lib/rails_best_practices/reviews/add_model_virtual_attribute_review.rb

Contribute

# Make a new branch

git checkout -b -your-name--update-docs-RailsBestPractices--Reviews--AddModelVirtualAttributeReview-call_assignment-for-pr


# Commit to git

git add lib/rails_best_practices/reviews/add_model_virtual_attribute_review.rbgit commit -m "better docs for RailsBestPractices::Reviews::AddModelVirtualAttributeReview#call_assignment"


# Open pull request

gem install hub # on a mac you can `brew install hub`

hub fork

git push <your name> -your-name--update-docs-RailsBestPractices--Reviews--AddModelVirtualAttributeReview-call_assignment-for-pr

hub pull-request


# Celebrate!