app/models/observation.rb
def share_on_facebook(options = {})
    fb_api = user.facebook_api
    return nil unless fb_api
    observations_to_share = if options[:single]
      [self]
    else
      Observation.includes(:taxon).limit(100).
        where(:user_id => user_id).
        where("observations.id >= ?", id).
        where("observations.taxon_id is not null")
    end
    observations_to_share.each do |o|
      fb_api.put_connections("me", "#{CONFIG.facebook.namespace}:record", :observation => FakeView.observation_url(o))
    end
  end
# share this (and any subsequent) observations on facebook
share this (and any subsequent) observations on facebook
share this ( and any subsequent ) observations on facebook
def share_on_facebook(options = {})
    fb_api = user.facebook_api
    return nil unless fb_api
    observations_to_share = if options[:single]
      [self]
    else
      Observation.includes(:taxon).limit(100).
        where(:user_id => user_id).
        where("observations.id >= ?", id).
        where("observations.taxon_id is not null")
    end
    observations_to_share.each do |o|
      fb_api.put_connections("me", "#{CONFIG.facebook.namespace}:record", :observation => FakeView.observation_url(o))
    end
  end
def share_on_facebook ( options = { } ) fb_api = user . facebook_api return nil unless fb_api observations_to_share = if options [ :single ] [ self ] else Observation . includes ( :taxon ) . limit ( 100 ) . where ( :user_id => user_id ) . where ( "observations.id >= ?" , id ) . where ( "observations.taxon_id is not null" ) end observations_to_share . each do | o | fb_api . put_connections ( "me" , "#{CONFIG.facebook.namespace}:record" , :observation => FakeView . observation_url ( o ) ) end end
share this (and any subsequent) observations on facebook
share this ( and any subsequent ) observations on facebook
options