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
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 |
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
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 |
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
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? |
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
class A | |
def a | |
puts 'a' | |
end | |
end | |
class B<A | |
def a | |
super() | |
puts 'b' |
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
Container = function( el ){ | |
var | |
me = { | |
el:el, | |
win: $( window ) | |
} | |
return me | |
} | |
Panel = function( el, params ){ |
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
#encoding: utf-8 | |
#Программа написана для ruby 1.9.2 | |
def get_next seq | |
puts next_seq = seq.split('').inject( [] ){ |s,w| | |
if s[-1].nil? || s[-1][1] != w | |
s << [1,w] | |
else | |
s[-1][0]+=1 | |
end | |
s |
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 A | |
def a_xx | |
end | |
end | |
module B | |
def b_xx | |
end | |
end |
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 A | |
def a_xx | |
end | |
end | |
module B | |
def b_xx | |
end | |
end |
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
Sample = function( el ) | |
{ | |
//mixins | |
var me = Container( el ) | |
//params | |
//,v1 = ... | |
//... | |
//dom elements |
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
require 'spec_helper' | |
def valid_layer_attributes | |
{ structure: { | |
f1: :array, | |
f2: :big_decimal, | |
f3: :boolean, | |
f4: :date, | |
f5: :date_time, | |
f6: :float, |
OlderNewer