Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert May committed Feb 2, 2014
2 parents 86e08ea + 8013d94 commit 2dd68af
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/collections_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 5 additions & 0 deletions app/controllers/notifications_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion app/models/comment.rb
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 3 additions & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion spec/controllers/collections_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 2dd68af

Please sign in to comment.