Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Amazon s3 #1

Merged
merged 2 commits into from
Dec 7, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ gem 'rails', '4.0.0'
gem 'jquery-rails'
gem 'devise'
gem 'simple_form', '~> 3.0.0.rc'
gem "paperclip", "~> 3.0"
gem "paperclip-dropbox"
gem "paperclip", "~> 4.3" #previously 3.0"
#gem "paperclip-dropbox"
gem 'aws-sdk', '~> 1.5.7'
gem "masonry-rails", '~> 0.2.0'
gem 'faker', "~> 1.2.0"
Expand All @@ -27,7 +27,7 @@ end


# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.0'
gem 'sass-rails', '~> 4.0.0'
# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 4.0.0'
# Use Uglifier as compressor for JavaScript assets
Expand Down
33 changes: 15 additions & 18 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ GEM
tzinfo (~> 0.3.37)
acts_as_follower (0.2.1)
arel (4.0.1)
atomic (1.1.14)
aws-sdk (1.5.8)
httparty (~> 0.7)
json (~> 1.4)
Expand All @@ -44,7 +43,7 @@ GEM
builder (3.1.4)
climate_control (0.0.3)
activesupport (>= 3.0)
cocaine (0.5.3)
cocaine (0.5.8)
climate_control (>= 0.0.3, < 1.0)
coderay (1.1.0)
coffee-rails (4.0.1)
Expand All @@ -60,8 +59,6 @@ GEM
railties (>= 3.2.6, < 5)
thread_safe (~> 0.1)
warden (~> 1.2.3)
dropbox-sdk (1.6.2)
json
erubis (2.7.0)
execjs (2.0.2)
faker (1.2.0)
Expand All @@ -70,7 +67,7 @@ GEM
httparty (0.12.0)
json (~> 1.8)
multi_xml (>= 0.5.2)
i18n (0.6.9)
i18n (0.7.0)
jbuilder (1.2.0)
activesupport (>= 3.0.0)
jquery-rails (3.0.4)
Expand All @@ -86,21 +83,20 @@ GEM
masonry-rails (0.2.1)
rails
mime-types (1.25.1)
mimemagic (0.3.0)
mini_portile (0.5.2)
minitest (4.7.5)
multi_json (1.8.2)
multi_json (1.11.2)
multi_xml (0.5.5)
nokogiri (1.6.0)
mini_portile (~> 0.5.0)
orm_adapter (0.5.0)
paperclip (3.5.2)
activemodel (>= 3.0.0)
activesupport (>= 3.0.0)
cocaine (~> 0.5.3)
paperclip (4.3.2)
activemodel (>= 3.2.0)
activesupport (>= 3.2.0)
cocaine (~> 0.5.5)
mime-types
paperclip-dropbox (1.1.7)
dropbox-sdk (~> 1.3)
paperclip (~> 3.1)
mimemagic (= 0.3.0)
pg (0.17.0)
polyglot (0.3.3)
protected_attributes (1.0.3)
Expand Down Expand Up @@ -151,15 +147,14 @@ GEM
sprockets (~> 2.8)
sqlite3 (1.3.8)
thor (0.18.1)
thread_safe (0.1.3)
atomic
thread_safe (0.3.5)
tilt (1.4.1)
treetop (1.4.15)
polyglot
polyglot (>= 0.3.1)
turbolinks (2.0.0)
coffee-rails
tzinfo (0.3.38)
tzinfo (0.3.46)
uglifier (2.3.2)
execjs (>= 0.3.0)
json (>= 1.8.0)
Expand All @@ -184,8 +179,7 @@ DEPENDENCIES
jquery-rails
jquery-turbolinks
masonry-rails (~> 0.2.0)
paperclip (~> 3.0)
paperclip-dropbox
paperclip (~> 4.3)
pg
protected_attributes
rails (= 4.0.0)
Expand All @@ -197,3 +191,6 @@ DEPENDENCIES
turbolinks
uglifier (>= 1.3.0)
will_paginate (~> 3.0.3)

BUNDLED WITH
1.10.6
5 changes: 5 additions & 0 deletions app/models/location.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class Location < ActiveRecord::Base
attr_accessible :city, :state, :zip, :address, :lat, :lng

has_many :pins
end
1 change: 1 addition & 0 deletions config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,5 @@
config.assets.debug = true
#In production, :host should be set to the actual host of your application.
config.action_mailer.default_url_options = { :host => 'localhost:3000' }
Paperclip.options[:command_path] = "/usr/local/bin/"
end
6 changes: 4 additions & 2 deletions config/initializers/paperclip.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# config/initializers/paperclip.rb
Paperclip::Attachment.default_options[:url] = ':event_sample_images.s3-website-us-east-1.amazonaws.com'
Paperclip::Attachment.default_options[:path] = '/:class/:attachment/:id_partition/:style/:filename'
unless Rails.env.development?
Paperclip::Attachment.default_options[:url] = ':event_sample_images.s3-website-us-east-1.amazonaws.com'
Paperclip::Attachment.default_options[:path] = '/:class/:attachment/:id_partition/:style/:filename'
end
14 changes: 14 additions & 0 deletions db/migrate/20131218231554_create_locations.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
class CreateLocations < ActiveRecord::Migration
def change
create_table :locations do |t|
t.string :address
t.string :city
t.string :state
t.string :zip
t.float :lat
t.float :lng

t.timestamps
end
end
end
13 changes: 12 additions & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 20130924014731) do
ActiveRecord::Schema.define(version: 20131218231554) do

create_table "follows", force: true do |t|
t.integer "followable_id", null: false
Expand All @@ -26,6 +26,17 @@
add_index "follows", ["followable_id", "followable_type"], name: "fk_followables"
add_index "follows", ["follower_id", "follower_type"], name: "fk_follows"

create_table "locations", force: true do |t|
t.string "address"
t.string "city"
t.string "state"
t.string "zip"
t.float "lat"
t.float "lng"
t.datetime "created_at"
t.datetime "updated_at"
end

create_table "pins", force: true do |t|
t.string "description"
t.datetime "created_at"
Expand Down
17 changes: 17 additions & 0 deletions test/fixtures/locations.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html

one:
address: MyString
city: MyString
state: MyString
zip: MyString
lat: 1.5
lng: 1.5

two:
address: MyString
city: MyString
state: MyString
zip: MyString
lat: 1.5
lng: 1.5
7 changes: 7 additions & 0 deletions test/models/location_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
require 'test_helper'

class LocationTest < ActiveSupport::TestCase
# test "the truth" do
# assert true
# end
end