Sha256: 0d7a9e12c834ba6a3d25563a541cfdf7501690a629c7f8b84918f6a7e4ece7c5

Contents?: true

Size: 373 Bytes

Versions: 1

Compression:

Stored size: 373 Bytes

Contents

class Knjtasks::User_task_list_link < Knj::Datarow
  has_one [
    :Task,
    :User
  ]
  
  def self.add(d)
    task = d.ob.get(:Task, d.data[:task_id])
    user = d.ob.get(:User, d.data[:user_id])
    
    link = d.ob.get_by(:User_task_list_link, {
      "task" => task,
      "user" => user
    })
    raise _("That user has already listed that task.") if link
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
knjtasks-0.0.3 models/class_user_task_list_link.rb