search for: current_period

Displaying 4 results from an estimated 4 matches for "current_period".

2006 Mar 25
4
dynamic set_table_name for achives
How can I pass something to set_table_name so that I can switch tables on the fly for accessing archive data? If I could access sessions inside a model I would do something like: if @session[:current_period] set_table_name "statistics_" + @session[:archive_year] else set_table_name "statistics_" + Date.now.year end But since I cannot access the session from within a model how do I tell the model to archive data which is held in a different table eg. "statistics_2005&quo...
2010 May 10
3
Using Rails 3 edge to circumvent current_period bug?
I get an error using Rails 3 beta3 on Ruby 1.9.2-preview1 undefined method `current_period'' for nil:NilClass (NoMethodError) This commit should fix it http://github.com/rails/rails/commit/a0cc94b32e5b4e4dce50787eed1208406f99ea82 But I forgot how to ensure I am running on edge with Rails 3. Is it a special bundler command I need to use? Thanks! -- You received this message...
2009 Mar 20
1
Getting a Time Zone abbreviation from the full name?
...n that I have the full time zone as a string, I need to pass it into a data structure or object and then get the abbreviation. So far, the best I''ve found is (where myevent.time_zone is the full time zone string): ActiveSupport::TimeZone::ZONES.find{|z| z.name == myevent.time_zone}.tzinfo.current_period.abbreviation.to_s This returns "MST". But there''s gotta be a better way, right? (I just can''t seem to find one) Anyone? -Danimal --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby...
2006 Mar 25
1
Re: Rails Digest, Vol 18, Issue 656
...8bad7421@ruby-forum.com> > Content-Type: text/plain; charset=utf-8 > > How can I pass something to set_table_name so that I can switch tables > on the fly for accessing archive data? > > If I could access sessions inside a model I would do something like: > > if @session[:current_period] > set_table_name "statistics_" + @session[:archive_year] > else > set_table_name "statistics_" + Date.now.year > end > > But since I cannot access the session from within a model how do I tell > the model to archive data which is held in a different tab...