Edge Rails Updates

Published on Author Akhil Bansal7 Comments

New edge rails deprecations:

Time#last_year is deprecated in favor of Time#prev_year
Time#last_month is deprecated in favor of Time#prev_month

Date#last_year is deprecated in favor of Date#prev_year
Date#last_month is deprecated in favor of Date#prev_month

New methods/aliases:

Date#sunday: Returns a new Date representing the end of this week
Time#sunday: Returns a new Time representing the end of this week
rename_index: Rename database index
Ex: rename_index :people, ‘index_people_on_last_name’, ‘index_users_on_last_name’

Feel free to add more as comments..

7 Responses to Edge Rails Updates

  1. cookies.permanent.signed[:remember_me] = current_user.id
    redirect_to ‘/nowhere’, :alert => “Beware the nowheres!”
    Object#presence that returns the object if it’s #present? otherwise returns nil. Example: region = params[:state].presence

Leave a Reply

Your email address will not be published. Required fields are marked *