Sha256: fbff14bfaf50d5896bcbe70e99a2e1f0927b5aaaa0665ab348b03aff197614df

Contents?: true

Size: 750 Bytes

Versions: 28

Compression:

Stored size: 750 Bytes

Contents

module Renalware
  module HD
    module SessionScopes
      def with_sessions_falling_within(period)
        falling_within(period)
      end

      # TODO: Refactor to two methods/scopes or'ed together e.g. finished_closed.or.finished_dna
      def falling_within(range)
        where(hd_sessions: {
                type: Session::Closed.sti_name,
                signed_off_at: range
              }).or(
          where(hd_sessions: {
                  type: Session::DNA.sti_name,
                  performed_on: range
                }))
      end

      def with_finished_sessions
        finished
      end

      def finished
        where(hd_sessions: { type: [Session::Closed.sti_name, Session::DNA.sti_name] })
      end
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
renalware-core-2.0.8 app/models/concerns/renalware/hd/session_scopes.rb
renalware-core-2.0.7 app/models/concerns/renalware/hd/session_scopes.rb
renalware-core-2.0.5 app/models/concerns/renalware/hd/session_scopes.rb
renalware-core-2.0.4 app/models/concerns/renalware/hd/session_scopes.rb
renalware-core-2.0.3 app/models/concerns/renalware/hd/session_scopes.rb
renalware-core-2.0.2 app/models/concerns/renalware/hd/session_scopes.rb
renalware-core-2.0.1 app/models/concerns/renalware/hd/session_scopes.rb
renalware-core-2.0.0 app/models/concerns/renalware/hd/session_scopes.rb
renalware-core-2.0.0.pre.rc13 app/models/concerns/renalware/hd/session_scopes.rb
renalware-core-2.0.0.pre.rc11 app/models/concerns/renalware/hd/session_scopes.rb
renalware-core-2.0.0.pre.rc10 app/models/concerns/renalware/hd/session_scopes.rb
renalware-core-2.0.0.pre.rc9 app/models/concerns/renalware/hd/session_scopes.rb
renalware-core-2.0.0.pre.rc8 app/models/concerns/renalware/hd/session_scopes.rb
renalware-core-2.0.0.pre.rc7 app/models/concerns/renalware/hd/session_scopes.rb
renalware-core-2.0.0.pre.rc6 app/models/concerns/renalware/hd/session_scopes.rb
renalware-core-2.0.0.pre.rc5 app/models/concerns/renalware/hd/session_scopes.rb
renalware-core-2.0.0.pre.rc4 app/models/concerns/renalware/hd/session_scopes.rb
renalware-core-2.0.0.pre.rc3 app/models/concerns/renalware/hd/session_scopes.rb
renalware-core-2.0.0.pre.rc1 app/models/concerns/renalware/hd/session_scopes.rb
renalware-core-2.0.0.pre.beta12 app/models/concerns/renalware/hd/session_scopes.rb