Skip to content

Instantly share code, notes, and snippets.

class CreateCashes < ActiveRecord::Migration
def change
create_table :cashes do |t|
t.datetime :start_at
t.datetime :end_at
t.decimal :value_open
t.decimal :value_phisic_closed
t.decimal :value_system_closed
t.timestamps
class Banner < ActiveRecord::Base
attr_accessor :image_width, :image_height
mount_uploader :image, ImageUploader
validate :check_dimensions
def check_dimensions
if !self.image_cache.nil?
errors.add :image, "Dimensions of uploaded avatar should be not less than 150x150 pixels." if self.upload_width < 150 || self.upload_height < 150
end
# Mac OSX
# Ruby on Rails Development Environment
#After Install Xcode and Command Line Tools:
# Homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# Basic packages
brew install macvim imagemagick mysql postgresql redis git ack mongodb node