This file contains 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
module Scope | |
def self.included(base) | |
base.has_scope :with_name_like | |
base.has_scope :with_title_like | |
end | |
end | |
class PostsController < ApplicationController | |
include Scope |
This file contains 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
ActiveRecord.where('created_at > ?', Time.now).to_sql |
This file contains 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
# see what the confidence code means here: | |
# http://www.mapquestapi.com/geocoding/geocodequality.html | |
Web::Address.from_params({ :street => "Canal Road", :city => "Orleans", :state => "MA", :country => "US" }) | |
[{"country_name"=>"United States", | |
"city"=>"Orleans", | |
"@name"=>"location", | |
"latitude"=>41.796795, | |
"country"=>"US", |
This file contains 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
-- fdsafdas | |
- fasdfdsa | |
fdasfdas |
NewerOlder