Class: Gemgento::Country

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/gemgento/country.rb

Overview

Author:

  • Gemgento LLC

Instance Method Summary collapse

Instance Method Details

#as_json(options = nil) ⇒ Hash

JSON representation of the Country.

Parameters:

  • options (Hash) (defaults to: nil)

Returns:

  • (Hash)


13
14
15
16
17
18
# File 'app/models/gemgento/country.rb', line 13

def as_json(options = nil)
  result = super
  result[:regions] = self.regions if self.regions.loaded?

  return result
end