Sha256: c2c0327d972b618b35a99f0709743d163394f94bbcb99cce06632c6f57eeb6ee

Contents?: true

Size: 439 Bytes

Versions: 11

Compression:

Stored size: 439 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

11 entries across 11 versions & 1 rubygems

Version Path
disco_app-0.12.0 test/dummy/app/models/disco_app/shop.rb
disco_app-0.12.1 test/dummy/app/models/disco_app/shop.rb
disco_app-0.12.5 test/dummy/app/models/disco_app/shop.rb
disco_app-0.12.6 test/dummy/app/models/disco_app/shop.rb
disco_app-0.12.7 test/dummy/app/models/disco_app/shop.rb
disco_app-0.13.0 test/dummy/app/models/disco_app/shop.rb
disco_app-0.13.1 test/dummy/app/models/disco_app/shop.rb
disco_app-0.13.2 test/dummy/app/models/disco_app/shop.rb
disco_app-0.13.3 test/dummy/app/models/disco_app/shop.rb
disco_app-0.13.4 test/dummy/app/models/disco_app/shop.rb
disco_app-0.12.7.pre.puma.pre.3 test/dummy/app/models/disco_app/shop.rb