Skip to content

gzzengwei/rails4_upgrade_syntax

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Rails4 Upgrade Syntax

update code syntax for rails 4

Current Progress

find_by
find_or_initialize_by
find_or_create_by

Example

client.users.find_by_user_id_and_organisation_id(current_user.id, current_user.organisation.id).update(:enabled, true)
#=>
client.users.find_by(user_id: current_user.id, organisation_id: current_user.organisation.id).update(:enabled, true)

Usage

rails4_upgrade_syntax.rb <target folder or file>

Or

ruby rails4_upgrade_syntax.rb <target folder or file>

Notes

  1. Processed by lines
  2. accepting parentheses inside find_xP_by()

About

update code syntax for rails 4

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages