Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Remove instagram from the controller because that was super dumb. sor…

…ry guys. :[
  • Loading branch information...
commit 4b771376420f63828ce84d9a8e580d0829317155 1 parent 9aeb274
@kaiuhl kaiuhl authored
View
10 app/controllers/application_controller.rb
@@ -1,13 +1,3 @@
class ApplicationController < ActionController::Base
protect_from_forgery
- before_filter :configure_instagram
-
- private
-
- def configure_instagram
- Instagram.configure do |config|
- config.client_id = INSTAGRAM_CLIENT_ID
- config.client_secret = INSTAGRAM_CLIENT_SECRET
- end
- end
end
View
9 app/models/instagram_search.rb
@@ -1,5 +1,12 @@
class InstagramSearch
- def self.at(lat, lng)
+ def initialize
+ Instagram.configure do |config|
+ config.client_id = INSTAGRAM_CLIENT_ID
+ config.client_secret = INSTAGRAM_CLIENT_SECRET
+ end
+ end
+
+ def at(lat, lng)
Instagram.media_search(lat, lng)
end
end
View
2  spec/models/instagram_search_spec.rb
@@ -1,7 +1,7 @@
require 'spec_helper'
describe InstagramSearch do
- let!(:instagram) { InstagramSearch.at(45.5, -122.69) }
+ let!(:instagram) { InstagramSearch.new.at(45.5, -122.69) }
it "returns a hash including photos" do
instagram.class.should eq(Hash)
Please sign in to comment.
Something went wrong with that request. Please try again.