- http://edgeguides.rubyonrails.org/4_1_release_notes.html
- http://coherence.io/blog/2013/12/17/whats-new-in-rails-4-1.html
- http://www.slideshare.net/godfreykfc/rails-41
- https://gist.github.com/chancancode/7781341
- http://edgeguides.rubyonrails.org/upgrading_ruby_on_rails.html#upgrading-from-rails-4-0-to-rails-4-1
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 Player | |
def play_turn(warrior) | |
warrior.walk! | |
end | |
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
rails _3.2.15_ new rails_update --database=postgresql --skip-bundle | |
rails _4.1.0_ new rails_update --database=postgresql --skip-bundle |
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
# Additional translations at http://github.com/plataformatec/devise/wiki/I18n | |
cs: | |
errors: | |
messages: | |
already_confirmed: 'byl již potvrzen, prosím, zkuste se přihlásit' | |
confirmation_period_expired: 'musí být potvrzen během %{period}, požádejte prosím o nový' | |
expired: 'vypršel, požádejte prosím o nový' | |
not_found: 'nenalezen' | |
not_locked: 'nebyl uzamčen' |
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
<?php | |
/** | |
* Provide very simple abstraction above database row (DibiRow replacement) | |
* | |
* @author Roman Sklenář | |
* @copyright Copyright (c) 2009 Roman Sklenář (http://romansklenar.cz) | |
* @license New BSD License | |
* @version 0.1 |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 Foo < ActiveRecord::Base | |
attr_accessor :timestamp_control | |
after_initialize { self.timestamp_control ||= Time.zone.now } | |
before_validation :overwrite_check | |
def overwrite_check | |
errors[:base] << I18n.t('errors.messages.overwritten') if updated_at > timestamp_control | |
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
require 'open-uri' | |
require 'roo' | |
apple = Company.create! do |company| | |
company.name = "Apple Inc." | |
company.code = "AAPL" | |
company.messages_url = "http://finance.yahoo.com/rss/headline?s=#{company.code}" | |
company.stocks_url = "http://ichart.finance.yahoo.com/table.csv?s=#{company.code}" | |
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
# company_names = (1..15).map { Faker::Company.name } | |
company_names = %w[Design Marketing Branding Stores Mobile Desktop Software Hardware] # departments | |
data = (1..500).map do | |
[ company_names.sample, | |
name = Faker::Name.name, | |
Faker::Internet.free_email(name.parameterize), | |
Faker::Internet.user_name(name.parameterize), | |
SecureRandom.urlsafe_base64(10).gsub('-', '') ] | |
end |
OlderNewer