search for: expires_at

Displaying 8 results from an estimated 8 matches for "expires_at".

2006 May 02
2
flash not shown
I am using the following code (inspired by one of the books) to check if the user''s session should have timed out. # Check to see if the user has been inactive for longer than the # expiry period. If they have, reset the session. def check_timeout if session[:expires_at] != nil @time_left = (session[:expires_at] - Time.now).to_i unless @time_left > 0 reset_session # TODO - This flash is never shown, because we redirect maybe? flash[:error] = ''Your session has timed out, please login to continue.'' re...
2013 Aug 26
2
linkedin login using omniauth
...m trying to add linkedin login feature in my rails application using omniauth gem..I used omniauth gem for Fb login and it''s working fine..but it''s not working for linkedin login this is my code /model/user.rb class User < ActiveRecord::Base attr_accessible :name, :oauth_expires_at, :oauth_token, :provider, :uid def self.from_omniauth(auth) where(auth.slice(:provider, :uid)).first_or_initialize.tap do |user| user.provider = auth.provider user.uid = auth.uid user.name = auth.info.name user.oauth_token = auth.credentials.token user.oauth_ex...
2009 Feb 02
2
did_not_yield
...eted in 0ms (DB: 12) | [http://127.0.0.1/scanns/status] I think what it says is nothing happened ? class ApplicationController < ActionController::Base ... protected ## attention, below here, all methods are PROTECTED def log_test session[:auth] ? ( @time_left = (session[:expires_at] - Time.now).to_i @time_left<0 ? ( flash[:notice] = ''Too much time without activity ... login_required ''+session[:expires_at].to_s @login_info=''Too much time without activity ... login_required ''+session[:expires_at].to_s ) : (@login_info...
2006 Jul 10
1
Redirects and keeping flash
My code that acts if a session has timed out looks like this: reset_session session[:expires_at] = nil # TODO - This flash is never shown, because we redirect maybe? flash[:error] = ''Your session has timed out, please login to continue.'' # An attempt to make flash stick around, not working flash.keep redirect_to :controller => ''security'', :act...
2012 Jul 23
2
Mechanize::Agent#post_connect_hook response != Mechanize#parse response
...POK into a Mechanize::Header? * Am I pursuing a fools errand? That is, has someone already implemented this in some lovely gem? [Minutia: There are lots of details I''ve glossed over: I don''t want to cache responses that are the result of errors. I want to implement and honor an expires_at: timestamp in the cached record. I''ll have to decide if chunked responses need special handling. Probably other things.]
2006 Mar 22
4
How to write this SQL query?
Hi! Is there rails version of "where column in (value1, value2, ...)"? I know i could do OR many times, but this way is shorter. I''m ruby/rails newbie, so i have a problem with converting the hash, which i''m receving from the search form into the string for :conditions in find method. Could i instead of creating one, complicated (for me) query do something like
2006 Sep 05
0
rake craziness with Migrate as a dependency
...0s -- create_table("user_registrations", {:force=>true}) -> 0.2000s -- add_index("user_registrations", ["user_id"], {:name=>"user_registrations_user_id_index", :unique=>true}) -> 0.2400s -- add_index("user_registrations", ["expires_at"], {:name=>"user_registrations_expires_at_index"}) -> 0.1810s -- create_table("users", {:force=>true}) -> 0.0900s -- add_index("users", ["login"], {:name=>"users_login_index", :unique=>true}) -> 0.2100s -- add_inde...
2006 Jun 19
13
PNG and Alpha-Transparency
Is there a prototype / extension which will assist in cross-browser support of PNG images? http://www.alistapart.com/articles/pngopacity/ It seems to me that a class could be developed which would zip through the DOM and make changes where needed for IE 5.5 / IE 6.0 to handle PNG images. I don''t want to write one if it''s been done before. Sam