This file contains hidden or 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
| <%= @profile.showable_videos.each do |v| %> | |
| <%= User.find_by_id(v.user_id).name showed the song Video.find_by_id(v.video_id).title to you. %> | |
| <% end %> |
This file contains hidden or 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
| def notification_go | |
| current_user.render_read | |
| respond_to do |format| | |
| format.html | |
| format.js | |
| end | |
| end |
This file contains hidden or 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
| NOTIFICATIONS_CONDITION = 'some SQL' | |
| has_many :user_notifications | |
| has_many :notifications, :through => :user_notifications, | |
| :conditions => NOTIFICATIONS_CONDITION, | |
| :order => "timeline_events.created_at DESC" |
This file contains hidden or 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
| ActiveRecord::StatementInvalid in Videos#index | |
| Showing /rubyprograms/dreamstill/app/views/videos/index.html.erb where line #12 raised: | |
| SQLite3::SQLException: no such table: user_notifications: SELECT COUNT(*) FROM "timeline_events" INNER JOIN "user_notifications" ON "timeline_events".id = "user_notifications".notification_id WHERE (("user_notifications".user_id = 58) AND .......... |
This file contains hidden or 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
| ActiveRecord::HasManyThroughSourceAssociationNotFoundError in Videos#index | |
| Showing /rubyprograms/dreamstill/app/views/videos/index.html.erb where line #12 raised: | |
| Could not find the source association(s) :notification or :notifications in model UserNotification. Try 'has_many :notifications, :through => :user_notifications, :source => <name>'. Is it one of :user? |
This file contains hidden or 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
| has_many :user_notifications | |
| NOTIFICATIONS_CONDITION = '(actor_type = \'User\' AND ((secondary_subject_type = \'Video\' AND secondary_subject_id IN (SELECT id FROM videos WHERE user_id = #{id})) OR (secondary_subject_type = \'User\' AND secondary_subject_id = #{id})))' | |
| has_many :notifications, :through => :user_notifications, | |
| :finder_sql => 'SELECT timeline_events.* FROM timeline_events | |
| WHERE ' + NOTIFICATIONS_CONDITION + ' | |
| ORDER BY timeline_events.created_at DESC' |
This file contains hidden or 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
| AREL (0.3ms) UPDATE "users" SET "new_notification_count" = -1, "updated_at" = '2011-05-07 08:48:13.440257' WHERE "users"."id" = 57 |
This file contains hidden or 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
| def erase_notification_count | |
| self.new_notification_count = (self.notifications.count * (-1)) | |
| self.save | |
| end | |
| def notification_count | |
| if self.new_notification_count.nil? | |
| new_notification_count = 0 | |
| end | |
| self.new_notification_count += self.notifications.count |
This file contains hidden or 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
| def notification_count(user) | |
| new_notifcation_count = new_notification_count || 0 | |
| new_notification_count = new_notification_count + user.notifications.count | |
| return new_notification_count | |
| end | |
| def erase_notification_count | |
| new_notification_count = current_user.notifications.count * (-1) | |
| end |
This file contains hidden or 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
| Missing partial notifications/comment_added with {:formats=>[:html], :handlers=>[:builder, :rjs, :rhtml, :erb, :rxml], :locale=>[:en, :en]} in view paths "/rubyprograms/dreamstill/app/views" |