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
| #Nginx | |
| rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/$(uname -m)/epel-release-5-3.noarch.rpm | |
| yum install nginx | |
| ▪ Default config file: /etc/nginx/nginx.conf | |
| ▪ Default SSL config file: /etc/nginx/conf.d/ssl.conf | |
| ▪ Default virtual hosting config file: /etc/nginx/conf.d/virtual.conf | |
| ▪ Default documentroot: /usr/share/nginx/html |
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 Node < ActiveRecord::Base | |
| before_save :abstract_class? | |
| col :title, :length => 100 | |
| col :description, :as => :text | |
| col :assumptions, :as => :text | |
| col :type, :length => 20 | |
| col :project, :as => :belongs_to, :index => true | |
| timestamps | |
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 TimeUnit < ActiveEnum::Base | |
| value :id => 1, :name => 'Days' | |
| value :id => 2, :name => 'Weeks' | |
| value :id => 3, :name => 'Months' | |
| value :id => 4, :name => 'Quaters' | |
| value :id => 5, :name => 'Years' | |
| end | |
| class Project < ActiveRecord::Base | |
| col :name, :limit => 100 |
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 Application < ActiveRecord::Base | |
| set_table_name "application_settings" | |
| col :key, :limit => 50 | |
| col :value, :limit => 100 | |
| def self.method_missing(method, *args, &block) | |
| return self.send method, *args, &block if self.respond_to? method | |
| if method.to_s =~ /=/ |
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(File.join(File.dirname(__FILE__), 'config', 'boot')) | |
| require 'rake' | |
| namespace :db do | |
| desc "Auto migration of database" | |
| task :migrate do | |
| Dir["app/models/*.rb"].each do |file_path| | |
| basename = File.basename(file_path, File.extname(file_path)) | |
| clazz = basename.camelize.constantize | |
| clazz.auto_upgrade! |
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
| has_attached_file :file, :styles => lambda { |media_file| media_file.instance.media_type == 'image' ? IMAGE_VERSIONS : {} }, | |
| :storage => :s3, | |
| :path => ":storage_path", | |
| :bucket => lambda{ |media_file| media_file.instance.bucket_name }, | |
| :s3_credentials => "#{RAILS_ROOT}/config/s3.yml", | |
| :url => ":s3_eu_url" | |
| before_save :normalize_file_file_name | |
| # == Filename helper |