Sha256: 58e1e9f6696e3b8396c363af79ac8fa7d9ebfb0cabfca4fe73d32577fc20654a

Contents?: true

Size: 284 Bytes

Versions: 4

Compression:

Stored size: 284 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(:date).last.try(:project)
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
bookyt_projects-0.18.2 app/models/bookyt_projects/person.rb
bookyt_projects-0.18.1 app/models/bookyt_projects/person.rb
bookyt_projects-0.14.0 app/models/bookyt_projects/person.rb
bookyt_projects-0.13.0 app/models/bookyt_projects/person.rb