This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class User < ActiveRecord::Base | |
acts_as_authentic do |config| | |
config.validate_password_field :if => :require_password_on_signup? | |
end | |
def require_password_on_signup? | |
false | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
require 'geonames' # ppe-ruby-geonames | |
class PostalCodeSearch | |
include Geonames | |
def initialize(postal_code, country_code = "US") | |
@postal_code = postal_code | |
@country_code = country_code | |
@response = nil |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@zipcode = Zipcode.find_by_name("85023") | |
# Passing in a hash of search parameters is more convenient for my purposes, | |
# but searchlogic allows the second, chained method of searching also works. | |
@locations = Location.by_location(:origin => @zipcode, :within => 10).search(:name_like => "searchlogic", :city_is => "Phoenix") | |
@locations = Location.by_location(:origin => @zipcode, :within => 10).name_like("searchlogic").city_is("Phoenix") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "rubygems" | |
gem "hiroshi-pony" | |
require "pony" | |
Pony.mail({ | |
:to => "[email protected]", | |
:subject => "subject", | |
:body => "body", | |
:via => :smtp, :smtp => { | |
:host => 'smtp.gmail.com', |
NewerOlder