-
Notifications
You must be signed in to change notification settings - Fork 908
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
Diary entry comment subscriptions #1309
Merged
tomhughes
merged 15 commits into
openstreetmap:master
from
mikelmaron:diary_entry_subscribe
Oct 12, 2016
Merged
Changes from 1 commit
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
443080d
WIP diary comment subscriptions
mikelmaron 44b08cc
not api endpoints, moved to button, fixed notifier message, fixed tests
mikelmaron 3c01d2e
more idiomatic models for diary entry subscriptions
mikelmaron e055eaf
tests passing
mikelmaron bb22e23
css in right place; fix structure.sql
mikelmaron a32076a
fix rubocop warnings
mikelmaron 8272a53
fix rubocop warnings
mikelmaron 6b7ebf6
clean up comments
mikelmaron 43ef60b
break out author subscriptions to its own migration
mikelmaron 5cd00dd
rubocop clean up
mikelmaron 3726d56
last minor fixes
mikelmaron 6a57901
adding back trailing newlines
mikelmaron 99afab6
adding back trailing newlines
mikelmaron 3a14abd
Update structure.sql
mikelmaron be40536
merge upstream/master and resolve conflicts from https://github.com/o…
mikelmaron File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 10 additions & 2 deletions
12
db/migrate/20161002153425_add_join_table_between_users_and_diary_entries.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,19 @@ | ||
require "migrate" | ||
|
||
class AddJoinTableBetweenUsersAndDiaryEntries < ActiveRecord::Migration | ||
def change | ||
def self.up | ||
create_table :diary_entry_subscriptions, :id => false do |t| | ||
t.column :user_id, :bigint, :null => false | ||
t.column :diary_entry_id, :bigint, :null => false | ||
end | ||
|
||
add_index :diary_entry_subscriptions, [:user_id, :diary_entry_id], :unique => true, :name => "index_diary_subscriptions_on_user_id_and_diary_entry_id" | ||
add_primary_key :diary_entry_subscriptions, [:user_id, :diary_entry_id] | ||
add_index :diary_entry_subscriptions, [:diary_entry_id] | ||
add_foreign_key :diary_entry_subscriptions, :diary_entries, :name => "diary_entry_subscriptions_diary_entry_id_fkey" | ||
add_foreign_key :diary_entry_subscriptions, :users, :name => "diary_entry_subscriptions_user_id_fkey" | ||
end | ||
|
||
def self.down | ||
drop_table :diary_entry_subscriptions | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we disallow entry authors to unsubscribe to their entries?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see why. I can imagine a situation where a post attracts a lot of trolls and you just want to ignore it and move on for example?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually have no opinion one way or the other, so I'm okay with this.