Skip to content

Instantly share code, notes, and snippets.

class A
def a
puts 'a'
end
end
class B<A
def a
super()
puts 'b'
class PointShapesController < ApplicationController
caches_page :branches
def branches
respond_to{ |format|
valid_tile = Tile.valid_tile(params[:id])
raise HTTPStatus::NotFound if valid_tile.nil?
class Branch < ActiveRecord::Base
belongs_to :company
belongs_to :point_shape
belongs_to :poly_shape
#has_one :style, :through => :point_shape
define_index do
indexes company.name, :as => :company
indexes poly_shape.houses.name, :as => :house
indexes poly_shape.houses.street.name, :as => :street
class User < ActiveRecord::Base
attr_accessor :password
has_many :groups
validates_presence_of :email, :message => '.validates_presence_of_email'
validates_presence_of :password, :message => '.validates_presence_of_password'
#authorization and registration in this method
def self.get_authorized_user params
user = self.first :conditions => { :encrypted_password => encrypte( params[ :password ] ), :email => params[ :email ] }
return user if !!user