Class: SuperGood::SolidusTaxjar::Configuration

Inherits:
Spree::Base
  • Object
show all
Includes:
Spree::Preferences::Persistable
Defined in:
app/models/super_good/solidus_taxjar/configuration.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.defaultObject



21
22
23
# File 'app/models/super_good/solidus_taxjar/configuration.rb', line 21

def default
  first || create
end

Instance Method Details

#preferred_reporting_enabledObject



11
12
13
14
# File 'app/models/super_good/solidus_taxjar/configuration.rb', line 11

def preferred_reporting_enabled
  preferred_reporting_enabled_at_integer.present? &&
    DateTime.current.after?(preferred_reporting_enabled_at)
end

#preferred_reporting_enabled_atObject



16
17
18
# File 'app/models/super_good/solidus_taxjar/configuration.rb', line 16

def preferred_reporting_enabled_at
  Time.at(SuperGood::SolidusTaxjar.configuration.preferred_reporting_enabled_at_integer).to_datetime
end