Sha256: 30f38840e00a8cca5f27022bdf55aedab34868770a89f6f5a41b395c9aa83ace

Contents?: true

Size: 767 Bytes

Versions: 5

Compression:

Stored size: 767 Bytes

Contents

module ActsAsDailycred
  def acts_as_dailycred
    serialize :facebook, Hash
    serialize :twitter, Hash
    serialize :google, Hash
    serialize :github, Hash
    serialize :tags, Array
    serialize :referred, Array

    attr_accessible :email, :username, :created, :verified, :admin, :referred_by, :referred,
      :facebook, :tags, :provider, :uid, :token, :twitter, :google, :github
    extend ActsAsDailycred::SingletonMethods
  end
  module SingletonMethods
    def find_or_create_with_omniauth(model)
      @user = User.find_by_provider_and_uid(model[:provider], model[:uid]) || User.new
      @user.update_attributes model[:info]
      @user
    end
  end
  module InstanceMethods
  end
end
require 'active_record'
ActiveRecord::Base.extend ActsAsDailycred

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
dailycred-0.1.35 lib/dailycred/acts_as_dailycred.rb
dailycred-0.1.34 lib/dailycred/acts_as_dailycred.rb
dailycred-0.1.33 lib/dailycred/acts_as_dailycred.rb
dailycred-0.1.32 lib/dailycred/acts_as_dailycred.rb
dailycred-0.1.31 lib/dailycred/acts_as_dailycred.rb