Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7516121
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T01:02:08+00:00 2026-05-30T01:02:08+00:00

Consider I have a Task class like this : class Task { String title

  • 0

Consider I have a Task class like this :

class Task {
     String title
     Date   assignedOn
     User user
}

Now the user can have many tasks. Now consider there are 8 tasks already assigned to userX. Now the manager(a special kind of user) is creating a 2 tasks to that userX, now I have totally 10 tasks of the userX. It is easy to display all the 10 tasks to that user.

But what I want is, I need a way to display only those 2 tasks to that userX assuming that the userX have already viewed those 8 tasks.

A real world example would be Stackoverflow site itself. If the person is answering my question I get a notification stating 1 new answer on the q..... and I will view it. After some time, if any one answers my same question, I get a notification stating 1 new answer not 2 new answer as I have already viewed the first answer.

What are the ways I can use to do this? Any plugins available for this in grails?

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T01:02:09+00:00Added an answer on May 30, 2026 at 1:02 am

    In principle, i would add a boolean flag on the Task class to indicate if it has been viewed or not by the user like so:

    class Task {
      String title
      Date dateAssigned
      boolean viewStatus  // true indicates a read task
    
      static belongsTo = [assignedTo: User, assignedBy: User]
    }
    

    When creating a task the viewStatus flag would be set to false. Whenever the user views a particular task the viewStatus flag would be set by your program to true. It is therefore possible to query for just the un-read tasks to display to your user (using GORM) like so:

    def currentUser = // your currently logged in user
    Task.findTaskByViewStatusAndAssignedTo(false, currentUser)
    

    The query will return only any user tasks that have not been read by the user, assuming that the readStatus is properly set whenever a user reads a task.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Consider I have an anchor which looks like this <div class=res> <a href=~/Resumes/Resumes1271354404687.docx> ~/Resumes/Resumes1271354404687.docx
Rake (like make) is able to have many targets/tasks specified on invocation. Is it
Consider i have a user table and I have three columns mobilePhone , homePhone
I have a Project model which accepts nested attributes for Task. class Project <
This seems like such a simple task, but I'm having a hard time finding
this is more a conceptual question. Consider you have a php framework that runs
Task at hand:Consider a class ratingScore that represents a numeric rating for some thing
I have a method which should consider a collection of instances of a class
Consider I have the following text in a UILabel (a long line of dynamic
Consider I have a data grid, I need to find the number of rows

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.