• RSS
  • Delicious
  • Digg
  • Facebook
  • Twitter
  • Linkedin
  • Youtube

Edge Rails Updates

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 so far.

  1. [...] This post was mentioned on Twitter by Marcus Sá. Marcus Sá said: Edge Rails Updates http://bit.ly/dAjO4T [...]

  2. grosser says:

    Gnaa I like natural named methods, and last_year sounds way better then prev_year …

  3. pjm says:

    “Depricated” is deprecated in favor of “deprecated”.

    Sorry…

  4. Christoph says:

    @grosser Last year != letztes Jahr, its more like THE last year, like right before armageddon, so I think prev_year makes more sense

  5. Satish says:

    Post.reset_counters(1234, :comments)

  6. Akhil Bansal says:

    A new method rename_index is also added to rename database index.(Post updated)

  7. Satish says:

    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


Asset Pipeline has been extracted a...

The asset pipeline which was introduced in Rails 3.1, has ...

ClientSideValidations: Add/Map mode...

#/status/256699237230845952

Action and Page caching has been ex...

With the commit c82cf81f00f Action and Page caching has been extracted ...

turbo-sprockets-rails3: Speeds up ...

#/status/253420357841723393

EdgeRails: ActiveRecord::SessionSto...

With the commit 3324e28804 ActiveRecord::SessionStore is extracted out of Rails into ...

Asset Pipeline has been extracted a...

The asset pipeline which was introduced in Rails 3.1, has ...

ClientSideValidations: Add/Map mode...

#/status/256699237230845952

Action and Page caching has been ex...

With the commit c82cf81f00f Action and Page caching has been extracted ...

turbo-sprockets-rails3: Speeds up ...

#/status/253420357841723393

EdgeRails: ActiveRecord::SessionSto...

With the commit 3324e28804 ActiveRecord::SessionStore is extracted out of Rails into ...