Displaying 9 results from an estimated 9 matches similar to: "Missing methods patch for Time::Calculations"
2009 Feb 04
4
Rails 2.2.2 to_date and to_datetime methods
In the console I see this behaviour:
>> "19270412000000".to_date.methods
=> ["ns?", "mon", "ago", "end_of_month", "months_since",
"default_inspect", "minus_without_duration", ...
>> "19270412000000".to_date.class
=> Date
>> "19270412000000".class
=> String
>>
2006 Jun 08
2
how to add plugin to ActiveRecord
I''m trying to set a date field''s day to the last day of the month before
I save it. I can do this successfully now using this code:
class Account < ActiveRecord::Base
def before_save
self.exp_date = last_day_of_month(self.exp_date)
end
# Returns a Date object set to the last day of the current month
def last_day_of_month(date = Date.today)
next_month_str
2013 Mar 04
0
fields_for with accepts_nested_attributes: how to pass a value to a label
I can''t figure out how to pass a value from the following object build in
the controller:
class TimesheetsController < AC
...
def new
@timesheet = current_user.timesheets.new
now = Date.today
#generating 7 time entries: monday through sunday
(now.beginning_of_week..now.end_of_week).step { |date|
@timesheet.time_entries.build(:workdate; date)
end
end
...
In the
2009 Jun 07
17
ActiveRecord Classes
I''m having a little trouble with understanding how to work out the
schematic for some of my classes using ActiveRecord when a file is in my
lib directory:
Brief example:
Here''s the outline of the files in use:
....app
........controllers
............application_controller.rb
............rushing_offenses_controller.rb
........models
............rushing_offense.rb
....lib
2006 Jan 26
1
end_of_month()
I noticed that
ActiveSupport::CoreExtensions::Time::Calculations::ClassMethods.end_of_month()
returns a new Time with the time set to 00:00:00. I expected it to return
23:59:59.
Am I missing something? Should this be changed?
Scott
2008 Oct 14
4
replace_html not working
hallo, everyone
can anybody help me? i did add my code under ENGINES as a module in a
project. before the change , all worked . and the differenz between
both is only about application''s environment,
before is
Ruby version 1.8.6 (i486-linux)
RubyGems version 1.1.1
Rails version 2.0.2
Active Record version 2.0.2
Action Pack version 2.0.2
2011 Mar 14
0
Problems with viewing my calendar
Hey dudes,
i''m trying to build a small calendar into my app. I follow the steps
shown in http://railscasts.com/episodes/213-calendars, so i go with the
table_builder gem, which allows to use the calendar_for command. But
unfortunately it doesnt work or rather show the results in my
view-template. I even got no error-message.
It only shows this: (twice!!?!)
Calendar
< March 2011 >
2006 Mar 06
0
Number of actions per controller
Hi,
I''m coding the administration part of an application to deal with all the
administrative tasks the (authorized) user can perform in it.I found that as
all the actions are logically related, it''s ok to have them all in the same
"admin" controller, but I end up with more than 35 actions. I''m wondering if
I should split the actions in more focused logical
2002 Dec 15
2
isolinux
hey guys,
im attempting to build my own linux distro. My first step is too get a linux
kernel and ramdisk image on a bootable cd via isolinux.
my problem seems to NOT be with pxelinux/isolinux, but with the kernel. Im
not postive so here whats happening.
the machine boots, and loads isolinux from the cd and presents a "boot:"
prompt to me. after i type in the kernel label it seems