lib/timber/contexts/organization.rb in timber-2.0.24 vs lib/timber/contexts/organization.rb in timber-2.1.0.rc1

- old
+ new

@@ -1,5 +1,8 @@ +require "timber/context" +require "timber/util" + module Timber module Contexts # The organization context tracks the organization of the currently # authenticated user. # @@ -23,9 +26,10 @@ def initialize(attributes) @id = attributes[:id] @name = attributes[:name] end + # Builds a hash representation of containing simply objects, suitable for serialization. def as_json(_options = {}) {id: Timber::Util::Object.try(id, :to_s), name: name} end end end \ No newline at end of file