-
The new rake task assets:clean removes precompiled assets. [fxn]
-
Application and plugin generation run bundle install unless
--skip-gemfile
or--skip-bundle
. [fxn] -
Fixed database tasks for jdbc* adapters #jruby [Rashmi Yadav]
-
Template generation for jdbcpostgresql #jruby [Vishnu Atrai]
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 are trying to install in deployment mode after changing | |
your Gemfile. Run `bundle install` elsewhere and add the | |
updated Gemfile.lock to version control. | |
You have deleted from the Gemfile: | |
* guard-pow | |
* rb-fsevent |
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
# Sends the translated version of a given object attribute. | |
# | |
# Example: | |
# Given that locale is :fr | |
# t_attribute(@post, :description) | |
# will return @post.description_fr or fallback to @post.description. | |
def t_attribute(object, attribute) | |
localized_attribute = "#{attribute}_#{I18n.locale}" | |
object.respond_to?(localized_attribute) ? object.send(localized_attribute) : object.send(attribute) | |
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
class Product < ActiveRecord::Base | |
define_index do | |
# rest of the index ... | |
has merchant_id | |
has merchant.company, :as => :merchant_name, :type => :string | |
has brand_id, :type => :integer | |
has brand.name, :as => :brand_name, :type => :string |
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
rake routes | sed -e "1d" -e "s,^[^/]*,,g" | awk '{print $1}' | uniq | sort | |
Source: http://trevmex.com/post/3822870892/rails-one-liner-to-get-urls-from-rake-routes |
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
# Pluralize helper for French language. | |
# | |
# Because French pluralization has special rules : | |
# Example : | |
# pluralize(0, "degré") # => "0 degré" | |
# pluralize(1, "degré") # => "1 degré" | |
# pluralize(2, "degré") # => "2 degrés" | |
# pluralize(0.5, "degré") # => "0.5 degré" | |
# pluralize(1.9, "degré") # => "1.9 degré" | |
# pluralize(-1.9, "degré") # => "-1.9 degré" |