Class: Unico::RegistrationCadastralCertificate

Inherits:
Model
  • Object
show all
Defined in:
app/models/unico/registration_cadastral_certificate.rb

Direct Known Subclasses

RegistrationCadastralCertificate

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.same_fiscal_year_and_creditor_and_less_than_or_equal_me(some_fiscal_year, some_creditor_id, some_id) ⇒ Object



34
35
36
37
38
# File 'app/models/unico/registration_cadastral_certificate.rb', line 34

def self.same_fiscal_year_and_creditor_and_less_than_or_equal_me(some_fiscal_year, some_creditor_id, some_id)
  where(fiscal_year: some_fiscal_year)
    .where(creditor_id: some_creditor_id)
    .where(arel_table[:id].lteq(some_id))
end

Instance Method Details

#count_crcObject



44
45
46
# File 'app/models/unico/registration_cadastral_certificate.rb', line 44

def count_crc
  RegistrationCadastralCertificate.same_fiscal_year_and_creditor_and_less_than_or_equal_me(fiscal_year, creditor_id, id).count
end

#to_sObject



40
41
42
# File 'app/models/unico/registration_cadastral_certificate.rb', line 40

def to_s
  "#{count_crc}/#{fiscal_year}"
end