Displaying 5 results from an estimated 5 matches for "expires_on".
Did you mean:
expires_in
2008 Oct 26
0
daylight savings time difference with rspec?
Hi all,
I wanted to check this with you. I have an rspec example that checks
the correct expiration date set on an object. The expiration is set in
the model with
expires_on = Time.now + next_duration[phase]
where next_duration can either be in units of seconds or n.days (should
be the same thing). n can be 3, 7, 25, or 30 days.
in my example I check an interval because the two events are not
simultaneous between when the model calls Time.now and when the rspec
examp...
2006 Aug 10
0
polymorphic challenge
Hello guys,
I have 2 classes (I pasted small part of them here);
class Shop < ActiveRecord::Base
has_many :items, :as=> :itemable
protected
def self.paying_scope
with_scope(:find => {:conditions => ''expires_on > NOW()'', :include
=> [:address]}) do
yield
end
end
end
class Item < ActiveRecord::Base
belongs_to :itemable, :polymorphic => true
end
Shops has expires_on field which I check if they can be shown or not
during searches => NO PROBLEM
I need to do same thin...
2005 Oct 20
3
Missing id on date_select (0.14.1)
...ts and I noticed
that a template with this (a modified 0.13.1 generated scaffold).
<label for="credit_card_account">Account</label>
<%= text_field ''credit_card'', ''account'' %>
<label for="credit_card_expires_on">Expires on</label>
<%= date_select ''credit_card'', ''expires_on'', :discard_day =>
true, :start_year => start_year, :end_year => end_year %>
expands to this:
<label for="credit_card_account">Accou...
2006 Nov 27
0
how to select with a kind of through relation(has_one)
...ance
class Item <....
def self.find_by_ad_enabled(options={})
ad_enabled do
self.find :all, {:order => "RAND()"}.merge(options)
end
end
protected
def self.ad_enabled
with_scope(:find => {:conditions => ''memberships.ad_enabled = 1 and
shops.expires_on >= NOW() and shops.enabled = 1'', :include => [:shop,
:images, :membership]}) do
yield
end
end
end
create_table "items", :force => true do |t|
t.column "shop_id", :integer
....
end
create_table "shops", :force => true do |t|...
2006 Mar 10
14
Oracle Date type errors rails on edit
I have a table with "expires_on" a DATE field.
"Show" and "Destroy" work, but "Edit" errors:
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_view/helpers/date_helper.rb:150:in
`select_hour''
/usr/local/lib/ruby/gems/1.8/gems/actionpack-1.11.2/lib/action_view/helpers/date...