Sha256: af52cc8e9f71a4fb57e3ee4be5d48a9df025803a3f59890674e65d189b190f24

Contents?: true

Size: 370 Bytes

Versions: 17

Compression:

Stored size: 370 Bytes

Contents

class Task < ActiveRecord::Base
  belongs_to :project
  belongs_to :location
  belongs_to :user
    
  def is_active
    case
    when start_time && end_time 
      (start_time .. end_time) === Time.now
    when start_time && end_time.nil?
      start_time <= Time.now
    when start_time.nil && end_time
      end_time >= Time.now
    else
      true
    end
  end
end

Version data entries

17 entries across 17 versions & 6 rubygems

Version Path
captproton-restfulx-1.2.3 test/rails/models/task.rb
dima-restfulx-1.2.0 test/rails/models/task.rb
dima-restfulx-1.2.1 test/rails/models/task.rb
dima-restfulx-1.2.2 test/rails/models/task.rb
dima-restfulx-1.2.3 test/rails/models/task.rb
dima-restfulx-1.2.4 test/rails/models/task.rb
dima-ruboss4ruby-1.1.2 test/rails/models/task.rb
rlmattax-restfulx-1.2.4.1 test/rails/models/task.rb
restfulx-1.3.1 test/rails/models/task.rb
restfulx-1.3.0 test/rails/models/task.rb
restfulx-1.2.5 test/rails/models/task.rb
restfulx-1.2.3 test/rails/models/task.rb
restfulx-1.2.4 test/rails/models/task.rb
restfulx-1.2.1 test/rails/models/task.rb
restfulx-1.2.2 test/rails/models/task.rb
restfulx-1.2.0 test/rails/models/task.rb
ruboss4ruby-1.1.2 test/rails/models/task.rb