Its all about Ruby On Rails
ROR
Edge Rails: Time#current
Jul 5th
Returns Time.zone.now when config.time_zone is set, otherwise just returns Time.now
Edge Rails: Array#random_element
May 24th
Array#rand is deprecated in favor of Array#random_element and will be removed in Rails 3.
As per the comment added to the commit:
Array#rand is deprecated because it masks Kernel#rand within the Array class itself, which may be used by a 3rd party library extending Array in turn. See https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/4555
Edge Rails Updates
May 14th
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..
uninitialized constant ActionMailer::Quoting::Encoding
Apr 13th
Just a quick note, If you are getting “uninitialized constant ActionMailer::Quoting::Encoding” while using ActionMailer, then make sure that your mailer look like:
class Notifier < ActionMailer::Base
def signup_notification(recipient)
recipients recipient.email_address_with_name
bcc ["bcc@example.com"]
from "system@example.com"
subject "New account information"
body :account => recipient
end
end
Actually, yesterday we were getting “uninitialized constant ActionMailer::Quoting::Encoding” while using ActionMailer in production but it was working fine in all modes(development/production) on localhost. Our mailer was like:
class Notifier < ActionMailer::Base
def signup_notification(recipient)
@recipients = recipient.email_address_with_name
@bcc = ["bcc@example.com"]
@from = "system@example.com"
@subject = "New account information"
@body = :account => recipient
end
end
We could not find the actual issue with this mailer. But the above said error was disappeared when we changed the same mailer as following:
class Notifier < ActionMailer::Base
def signup_notification(recipient)
recipients recipient.email_address_with_name
bcc ["bcc@example.com"]
from "system@example.com"
subject "New account information"
body :account => recipient
end
end
Do you guys have any idea? I would love to listen from you.
Update: No its not solved yet. Still same issue. May be some issue with character encoding with the TMail object.
Update 2: This was the issue http://github.com/hmcgowan/roo/issues#issue/4/comment/106328
Jquery Full Calendar with RubyOnRails
Mar 29th
Cross Posted from http://vinsol.com/blog
Contrary to popular belief, working on a client project gives us a generous margin of creativity and explore innovative solutions.Take the example of a recent project I was working on. The client required a collaboration-based calendar module for their application similar to Google Calendar. Initially we started developing it from scratch , but then, we found an awesome Jquery plugin.
“FullCalendar” provides a full-sized, drag & drop calendar. It uses AJAX to fetch events on-the-fly for each month. It also supports an intuitive interface to manage events that spans over multiple days or weeks. It is visually customizable and exposes hooks for user-triggered events (like clicking or dragging an event).
I decided to give it a try and utilize its hooks for user triggered events within our Rails application. This small effort resulted in a barebone Rails app that might provide a good base for your project which require calendar, scheduling or appointment features. I called it fullcalendar_rails and it is now available on github with a working demo at http://fullcalendar.vinsol.com.
Update: Added recurring events functionality to the demo app.
Feel free to give your valuable feedback. I hope you will find this useful.