Socket
Book a DemoInstallSign in
Socket

has_gravatar

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

has_gravatar

0.0.2
bundlerRubygems
Version published
Maintainers
1
Created
Source

has_gravatar

Build Status Dependency Status

has_gravatar is intended to add easy access to gravatar URLs from Active Record models.

Installation

has_gravatar is distributed as a gem, which is how it should be used in your app.

First, include the gem in your Gemfile: gem "has_gravatar" And install it: bundle

After these two simple steps, has_gravatar is ready to be used on any Active Record model. In order to use it, call has_gravatar, passing one or more fields as argument. Example:

class User < ActiveRecord::Base
	has_gravatar :primary_email, :secondary_email, :email
end

Now, to get the Gravatar URL of a model, use:

user = User.first

# Returns http://gravatar.com/avatar/<hash>
user.email_gravatar
	
# Supports default images
user.email_gravatar default_avatar: 'http://my.domain.com/public/default_gravatar.png'
	
# And sizing
user.email_gravatar default_avatar: 'http://my.domain.com/public/default_gravatar.png', size: 128
	
# And HTTPS
user.email_gravatar default_avatar: 'http://my.domain.com/public/default_gravatar.png', size: 128, secure: true

Pull requests are welcome!

FAQs

Package last updated on 19 Jan 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.