Skip to content

Instantly share code, notes, and snippets.

View rubymerchant's full-sized avatar

Jatinder Singh rubymerchant

  • HotelTonight
  • San Francisco
View GitHub Profile
has_many :topic_activities, :conditions => {:context => Activity.topic_create}, :dependent => :delete_all, :class_name => "Activity", :foreign_key => "record_id"
class Post < ActiveRecord::Base
named_scope :published, :conditions => ["posts.published_at <= ? AND posts.published_at IS NOT NULL", Date.today.to_s(:db)],
:order => 'published_at DESC, id DESC'
end
# When I do Post.published from console on staging and production then published_at is compared with "2009-04-02",
# which is correct as today's date is "2009-04-02" on staging/production systems as well as GMT.
# However when above named_scope gets invoked as part of a request to PostsController, published_at is compared
# with "2009-04-01". now why is the date not "2009-04-02"?? here is the message from log.
<fb:login-button onlogin="ask_for_publish_stream_permission();"></fb:login-button>
function ask_for_publish_stream_permission(){
facebook_prompt_permission('publish_stream', function(accepted) {
if(accepted) {
/* Call TA to create/login the fb user */
new Ajax.Request('/fb_connect/create_user',
{
method:'post',
parameters: {
class SubscriptionCharge < ActiveRecord::Base
belongs_to :subscription
belongs_to :user
validate_on_create :payment
private
def payment
if user.charge(amount)
A Riddle::ResponseError occurred in rating_wizard#index:
searchd error (status: 1): too much attribute filters (req=262, max=256)
[RAILS_ROOT]/vendor/plugins/thinking-sphinx/vendor/riddle/lib/riddle/client.rb:482:in `request'
-------------------------------
Request:
-------------------------------
* URL : http://www.theauteurs.com/rate_films
diff --git a/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb b/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb
index 2812dbb..c1f44b5 100644
--- a/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb
+++ b/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb
@@ -76,7 +76,7 @@ module ActiveRecord
module ConnectionAdapters
class MysqlColumn < Column #:nodoc:
def extract_default(default)
- if type == :binary || type == :text
+ if sql_type =~ /blob/i || type == :text
module Delayed
class Job < ActiveRecord::Base
def log_exception(error)
logger.error "* [JOB] #{name} failed with #{error.class.name}: #{error.message} - #{attempts} failed attempts"
logger.error(error)
subject = "[JOB] #{name} failed."
body = "* [JOB] #{name} failed with #{error.class.name}: #{error.message} - #{attempts} failed attempts"
UserMailer.deliver_delayed_job_error_notification(subject, body)
end
*** LOCAL GEMS ***
actionmailer (2.3.2, 1.3.6)
actionpack (2.3.2, 1.13.6)
actionwebservice (1.2.6)
activerecord (2.3.2, 1.15.6)
activeresource (2.3.2)
activesupport (2.3.2, 1.4.4)
acts_as_ferret (0.4.1)
*** LOCAL GEMS ***
actionmailer (2.3.2, 1.3.6)
actionpack (2.3.2, 1.13.6)
actionwebservice (1.2.6)
activerecord (2.3.2, 1.15.6)
activeresource (2.3.2)
activesupport (2.3.2, 1.4.4)
acts_as_ferret (0.4.1)
(in /Users/jatindersingh/Desktop/bugmash/rails/activemodel)
/Users/jatindersingh/Desktop/bugmash/rails/vendor/gems/ruby/1.8/dirs/arel/lib/arel/algebra/relations/operations/lock.rb:6: warning: method redefined; discarding old initialize
/Users/jatindersingh/Desktop/bugmash/rails/activemodel/test/cases/../../../activerecord/lib/active_record/association_preload.rb:129: warning: `*' interpreted as argument prefix
(eval):1: warning: method redefined; discarding old where
(eval):1: warning: method redefined; discarding old having
/Users/jatindersingh/Desktop/bugmash/rails/activemodel/test/cases/../../../activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:116: warning: instance variable @active not initialized
Loaded suite /Users/jatindersingh/.gem/ruby/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader
Started
/Users/jatindersingh/Desktop/bugmash/rails/activemodel/test/cases/../../../activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:116: warning: instance variable @tr