Skip to content

Instantly share code, notes, and snippets.

Error:
NoMethodError (You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.[]):
Code:
@fb_friends = @graph.get_connections("me", "friends")
@returned_friends = @fb_friends.select { |k,v| v["name"] == "#{params[:term]}" }
https://github.com/arsduo/koala
'((actor_type = \'User\' AND actor_id IN (SELECT followed_id FROM relationships WHERE follower_id = #{id})) AND ((secondary_subject_type = \'Video\' AND subject_type <> \'Profile\' AND secondary_subject_id NOT IN (SELECT id FROM videos WHERE user_id = #{id})) OR (secondary_subject_type = \'User\' AND secondary_subject_id <> #{id}) OR (secondary_subject_type = \'nil\') OR (subject_type = \'Profile\' AND secondary_subject_id NOT IN (SELECT id FROM videos WHERE user_id = #{id}) AND subject_id NOT IN (SELECT id FROM profiles WHERE user_id = #{id}))))'
@meltzerj
meltzerj / user_notification.rb
Created May 22, 2011 06:26
The error is point to the read method in the user_notification model
def read
self.read = true if self.read == false
end
belongs_to :actor, :polymorphic => true
belongs_to :subject, :polymorphic => true
belongs_to :secondary_subject, :polymorphic => true
def heard
if params[:state] == 'yes'
@heard = true
elsif params[:state] == 'no'
@heard = false
end
respond_to do |format|
if ShowableVideo.find_by_id(params[:showable_video_id]).update_attributes(:heard => @heard)
http://stackoverflow.com/questions/6075910/why-is-rails-not-recognizing-that-i-want-an-ajax-request
53: <div id="showable_video_div">
54: <%= form_for [@video, @video.showable_videos.new ], :url => showable_videos_path, :remote => true do |f| %>
55: <%= f.hidden_field :video_id, :value => @video.id, :id => "video_id_field" %>
56: <%= f.text_field :user, :class => "showable_field" %>
57: <% end %>
</div>
ActiveRecord::StatementInvalid in ProfilesController#fetch_fb_picture
SQLite3::SQLException: unrecognized token: "'ÿØÿà": UPDATE "profiles" SET "photo_file_size" = 2634, "photo_file_name" = 'ÿØÿàJFIFÿþ;CREATOR: gd-jpeg v1.0 (using IJG JPEG v62), quality = 95
ÿÛC   
ÿÀ22"ÿÄ
ÿĵ}!1AQa"q2‘¡#B±ÁRÑð$3br‚
%&''()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyzƒ„…†‡ˆ‰Š’“”•–—˜™š¢£¤¥¦§¨©ª²³´µ¶·¸¹ºÂÃÄÅÆÇÈÉÊÒÓÔÕÖרÙÚáâãäåæçèéêñòóôõö÷øùúÿÄ
ÿĵw!1AQaq"2B‘¡±Á #3RðbrÑ
$4á%ñ&''()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz‚ƒ„…†‡ˆ‰Š’“”•–—˜™š¢£¤¥¦§¨©ª²³´µ¶·¸¹ºÂÃÄÅÆÇÈÉÊÒÓÔÕÖרÙÚâãäåæçèéêòóôõö÷øùúÿÚ ?øþ Íÿ‹øëÿµ¼ñ?…ì–ÇÃúEÀ³šúîê8ÄÅÇËs“´,vàm’q_l|ÿƒt~üøiçˆ><išv¥q¼ ¨\—ŽIZ-’Ĥ´LG™±Ð€Jƒ´îêy?ø!ÿď~øãƒ_ üs¦Çgk­Å«Á”j°],å—ƒ<R¼q§—µá&.To\6M¬ô[oŽ?­|mñîâÂö]9d·’Ö7‚"bhe;™Cm…öœž¸ç투êÊ »ßNÞWü¶É2&#/…yA8ÛÞ¾÷½¼–§ó%ã_Ùßâ߆<o¬ø*o\Ïu¢xŽ=öh°P]̲´–ÎÜȐJÊ{„4²þÌŸá#Îð
@meltzerj
meltzerj / This is my code
Created May 20, 2011 03:31
This is my error
@profile contains this: https://fbcdn-profile-a.akamaihd.net/hprofile-ak-snc4/157351_567412775_2309291_q.jpg
r = open(@picture)
image_data = r.read
file_size = r.length
mime_type = "image/jpeg"