gem install rails --pre
rails new my_app -T
class Person | |
include Mongoid::Document | |
field :name, :type => String | |
field :age, :type => Integer | |
field :address, :type => Hash | |
end | |
/***** ADDING THROUGH CONSOLE ******/ |
Person.all.each do |p| | |
arr = [p.first_name, p.last_name] | |
if p.middle_name.present? | |
arr.insert(1, p.middle_name) | |
end | |
p._keywords = arr | |
p.save | |
end |
# Structure for inheritance | |
# app/models/parent/base.rb | |
class Parent::Base | |
include Mongoid::Document | |
end | |
# app/models/parent/first_child.rb | |
class FirstChild < Parent::Base | |
# fields needed for first child |
[user] | |
name = your_username | |
email = [email protected] | |
[github] | |
user = github_username | |
token = github_your_own_token | |
[core] | |
#Global .gitignore file | |
excludesfile = /Users/millisami/.gitignore | |
editor = mate -w |
{ | |
"use_simple_full_screen": false, | |
// calculates indentation automatically when pressing enter | |
"auto_indent": true, | |
// sets the colors used within the text area (default) | |
// see https://github.com/olivierlacan/monokaim to download | |
// the customized Monokai I use. | |
"color_scheme": "Packages/Color Scheme - Default/Monokaim.tmTheme", |
require 'rubygems' unless defined? Gem # rubygems is only needed in 1.8 | |
def unbundled_require(gem) | |
loaded = false | |
if defined?(::Bundler) | |
Gem.path.each do |gems_path| | |
gem_path = Dir.glob("#{gems_path}/gems/#{gem}*").last |
source :rubygems | |
# We are not loading Active Record, nor Active Resources etc. | |
# We can do this in any app by simply replacing the rails gem | |
# by the parts we want to use. | |
gem "actionpack", "~> 3.2" | |
gem "railties", "~> 3.2" | |
gem "tzinfo" | |
# Let's use thin |