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..
[…] This post was mentioned on Twitter by Marcus Sá. Marcus Sá said: Edge Rails Updates http://bit.ly/dAjO4T […]
Gnaa I like natural named methods, and last_year sounds way better then prev_year …
“Depricated” is deprecated in favor of “deprecated”.
Sorry…
@grosser Last year != letztes Jahr, its more like THE last year, like right before armageddon, so I think prev_year makes more sense
Post.reset_counters(1234, :comments)
A new method rename_index is also added to rename database index.(Post updated)
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