Sha256: 94ac194a8b71c70e2a9f9a2bedb4f2a53ec5e41adcf8aac7a0472fce9f49a8f4

Contents?: true

Size: 291 Bytes

Versions: 2

Compression:

Stored size: 291 Bytes

Contents

module BookytProjects
  module Person
    extend ActiveSupport::Concern

    included do
      has_many :activities, :foreign_key => :person_id
    end

    module InstanceMethods
      def latest_project
        activities.order(:duration_to).last.try(:project)
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
bookyt_projects-0.12.0 app/models/bookyt_projects/person.rb
bookyt_projects-0.11.2 app/models/bookyt_projects/person.rb