Sha256: 53ec82f28ae86601c62f09557257ab937b5105ca4b517542dc883f7750775459

Contents?: true

Size: 438 Bytes

Versions: 5

Compression:

Stored size: 438 Bytes

Contents

require 'active_utils'

class DiscoApp::Shop < ActiveRecord::Base
  include DiscoApp::Concerns::Shop

  has_one :js_configuration
  has_one :widget_configuration
  has_many :carts
  has_many :products

  # Extend the Shop model to return the Shop's country as an ActiveUtils country.
  def country
    begin
      ActiveUtils::Country.find(data[:country_name])
    rescue ActiveUtils::InvalidCountryCodeError
      nil
    end
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
disco_app-0.13.5 test/dummy/app/models/disco_app/shop.rb
disco_app-0.13.6 test/dummy/app/models/disco_app/shop.rb
disco_app-0.13.7 test/dummy/app/models/disco_app/shop.rb
disco_app-0.13.8 test/dummy/app/models/disco_app/shop.rb
disco_app-0.13.6.pre.puma.pre.3 test/dummy/app/models/disco_app/shop.rb