Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Methods to expose only specified attributes in ActiveRecord when using the helpers to_json and to_xml

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 test
Octocat-spinner-32 .gitignore
Octocat-spinner-32 .travis.yml
Octocat-spinner-32 Gemfile
Octocat-spinner-32 Gemfile.lock
Octocat-spinner-32 README.md
Octocat-spinner-32 only_expose.gemspec
README.md

README

only_expose allows you to specify which attributes of an ActiveRecord method should be exposed when using to_json or to_xml. It makes exposing model data easier to manage.

Usage

class Foo < ActiveRecord::Base
  include OnlyExpose
  only_expose :name
end

This defines a class Foo which will only expose the attribute 'name' when to_json or to_xml is used.

Do as you please license.

Something went wrong with that request. Please try again.