Skip to content

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
...
  • 7 commits
  • 7 files changed
  • 0 commit comments
  • 1 contributor
View
2 Gemfile.lock
@@ -317,7 +317,7 @@ GEM
activesupport (= 4.0.2)
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
- rake (10.1.0)
+ rake (10.1.1)
rb-fsevent (0.9.3)
rb-inotify (0.9.0)
ffi (>= 0.5.0)
View
2 README.md
@@ -82,6 +82,8 @@ Copy one of those files to .env and populate it:
##### S3 is used in development
Due to the plugins used for handling uploads, S3 support is required even in development. It's not ideal, but you'll need to fill out those S3 keys in your .env file with details for your S3 bucket.
+In both development and production you will need to configure CORS correctly on Amazon. [See the README in the upload script we use for more details](https://github.com/waynehoover/s3_direct_upload).
+
Now start it up with Foreman:
`foreman start`
View
2 app/controllers/collections_controller.rb
@@ -49,7 +49,7 @@ def show
@collection = Collection.find(params[:id])
authorize! :read, @collection
track_view_for_collection(@collection)
- @photographs = @collection.photographs.visible.page(params[:page])
+ @photographs = @collection.photographs.view_for(current_user).page(params[:page])
respond_with @collection
end
View
5 app/controllers/notifications_controller.rb
@@ -28,6 +28,11 @@ def show
respond_with @notification do |f|
f.html { redirect_to path }
end
+
+ rescue ActiveRecord::RecordNotFound
+ respond_to do |f|
+ f.html { redirect_to root_path, alert: t("notifications.not_found") }
+ end
end
def mark_all_as_read
View
2 app/models/comment.rb
@@ -1,7 +1,7 @@
class Comment < ActiveRecord::Base
belongs_to :user
belongs_to :comment_thread, touch: true
- has_many :notifications, as: :notifiable
+ has_many :notifications, as: :notifiable, dependent: :destroy
has_many :reports, as: :reportable
acts_as_tree dependent: :destroy
View
3 config/locales/en.yml
@@ -469,6 +469,9 @@ en:
title: "Notifications"
none: "You have no notifications right now."
mark_as_read: "Mark all as read"
+ not_found: >
+ That notification could not be found, it is possible that the event which
+ generated it has changed.
email:
subject: "Photographer.io: %{subject}"
button: "View on Photographer.io"
View
2 spec/controllers/collections_controller_spec.rb
@@ -11,7 +11,7 @@
before do
controller.stub(:track_last_viewed_photographs) { nil }
collection.stub(:id) { 1 }
- collection.stub_chain(:photographs, :visible, :page) { photographs }
+ collection.stub_chain(:photographs, :view_for, :page) { photographs }
Collection.stub(:find) { collection }
end

No commit comments for this range

Something went wrong with that request. Please try again.