diff --git a/Gemfile b/Gemfile index 36060d7..49a4aaa 100644 --- a/Gemfile +++ b/Gemfile @@ -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" @@ -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 diff --git a/Gemfile.lock b/Gemfile.lock index b6630bc..371f50b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -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) @@ -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) @@ -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) @@ -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) @@ -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) @@ -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) @@ -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) @@ -197,3 +191,6 @@ DEPENDENCIES turbolinks uglifier (>= 1.3.0) will_paginate (~> 3.0.3) + +BUNDLED WITH + 1.10.6 diff --git a/app/models/location.rb b/app/models/location.rb new file mode 100644 index 0000000..7c2865d --- /dev/null +++ b/app/models/location.rb @@ -0,0 +1,5 @@ +class Location < ActiveRecord::Base + attr_accessible :city, :state, :zip, :address, :lat, :lng + + has_many :pins +end diff --git a/config/environments/development.rb b/config/environments/development.rb index 1de13fc..8cae1e0 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -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 diff --git a/config/initializers/paperclip.rb b/config/initializers/paperclip.rb index b6b54d3..9441342 100644 --- a/config/initializers/paperclip.rb +++ b/config/initializers/paperclip.rb @@ -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' \ No newline at end of file +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 diff --git a/db/migrate/20131218231554_create_locations.rb b/db/migrate/20131218231554_create_locations.rb new file mode 100644 index 0000000..a4f6bb1 --- /dev/null +++ b/db/migrate/20131218231554_create_locations.rb @@ -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 diff --git a/db/schema.rb b/db/schema.rb index 46a6ef5..3061914 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -47,11 +47,9 @@ t.integer "image_file_size" t.datetime "image_updated_at" t.string "image_remote_url" - t.integer "location_id" end add_index "pins", ["user_id"], name: "index_pins_on_user_id" - add_index "pins", ["location_id"], name: "index_pins_on_location_id", unique: true create_table "users", force: true do |t| t.string "email", default: "", null: false @@ -71,4 +69,5 @@ add_index "users", ["email"], name: "index_users_on_email", unique: true add_index "users", ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true + end diff --git a/test/fixtures/locations.yml b/test/fixtures/locations.yml new file mode 100644 index 0000000..5307686 --- /dev/null +++ b/test/fixtures/locations.yml @@ -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 diff --git a/test/models/location_test.rb b/test/models/location_test.rb new file mode 100644 index 0000000..cd10e31 --- /dev/null +++ b/test/models/location_test.rb @@ -0,0 +1,7 @@ +require 'test_helper' + +class LocationTest < ActiveSupport::TestCase + # test "the truth" do + # assert true + # end +end