-
The -j option of the application generator accepts an arbitrary string. If passed "foo", the gem "foo-rails" is added to the Gemfile, and the application JavaScript manifest requires "foo" and "foo_ujs". As of this writing "prototype-rails" and "jquery-rails" exist and provide those files via the asset pipeline. Default is "jquery". [fxn]
-
jQuery is no longer vendored, it is provided from now on by the jquery-rails gem. [fxn]
-
Prototype and Scriptaculous are no longer vendored, they are provided from now on by the prototype-rails gem. [fxn]
-
The scaffold controller will now produce SCSS file if Sass is available [Prem Sichanugrist]
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
source :rubygems | |
gem 'rails', '3.0.3' | |
gem 'mongo', '1.1.5' | |
gem 'bson', '1.1.5' | |
gem 'bson_ext', '1.1.5' | |
gem 'mongoid', '2.0.0.beta.20' | |
gem 'carrierwave' |
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
#creating a new collection called based on name supplied | |
def self.create_tenant(name) | |
@connection = Mongo::Connection.new | |
@db = @connection.db("#{name}") | |
@coll = @db.collection("#{name}") | |
end | |
#creating a new account should automatically create collection |
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
def md5hash | |
md5 = Digest::MD5.hexdigest(self.id.to_s + self.initial_sender_email + MD5_SECRET) | |
logger.info "DEBUG: md5 = " + md5 | |
return self.id.to_s + "-" + md5 | |
end | |
def check_md5(md5_to_check) | |
md5 = Digest::MD5.hexdigest(self.id.to_s + self.initial_sender_email + MD5_SECRET) | |
if md5 == md5_to_check | |
return true |
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
# Install the MongoDB gem | |
%w{ mongo bson_ext }.each do |mongo_gem| | |
gem_install = gem_package mongo_gem do | |
action :nothing | |
end | |
gem_install.run_action(:install) | |
end | |
Gem.clear_paths | |
require 'mongo' |
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 'carrierwave/processing/mini_magick' | |
class ImageUploader < CarrierWave::Uploader::Base | |
include CarrierWave::MiniMagick | |
IMAGE_EXTENSIONS = %w(jpg jpeg gif png) | |
DOCUMENT_EXTENSIONS = %w(exe pdf doc docm xls) | |
def store_dir | |
"files/#{model.id}" |
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
#managing upload | |
gem 'carrierwave' | |
#for generating json and xml api | |
gem 'rabl' | |
#for styling the app | |
gem "twitter-bootstrap-rails" | |
#no sql-persistentce |
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
// You can run it here http://jsfiddle.net/Wjtcj/5/ | |
App = Ember.Application.create(); | |
App.and = Ember.computed.and = function(dependentKey, otherKey) { | |
return Ember.computed(dependentKey, otherKey, function(key) { | |
return get(this, dependentKey) && get(this, otherKey); | |
}); | |
}; | |
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 SoftDelete | |
extend ActiveSupport::Concern | |
included do | |
define_model_callbacks :soft_delete | |
define_model_callbacks :recover | |
default_scope where(:deleted_at => nil) | |
class_eval do | |
class << self | |
alias_method :with_deleted, :unscoped |
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
Loading development environment (Rails 4.0.0) | |
2.0.0-p247 :001 > Date.today | |
=> Thu, 26 Sep 2013 | |
2.0.0-p247 :002 > Date.tomorrow | |
=> Thu, 26 Sep 2013 |
OlderNewer