Sha256: 119b4c77e86241d25e4198042eb205ed2a3fdecbf5345a784338b2ca8d2f9373
Contents?: true
Size: 426 Bytes
Versions: 6
Compression:
Stored size: 426 Bytes
Contents
User.class_eval do include SocialStream::Oauth2Server::Models::User def as_json_with_client options = {} hash = as_json_without_client options if options[:client] && !options[:client].is_a?(User) hash['roles'] = options[:client].contact_to!(self).relations.map{ |r| { id: r.id, name: r.name } } end hash end alias_method_chain :as_json, :client end
Version data entries
6 entries across 6 versions & 2 rubygems