- @udzura
- ちょっと前までエーミングでC#を書いてました
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
gem 'rails3-generators' | |
gem 'mongoid', '>= 2.0.0.beta' | |
gem 'bson_ext' | |
gem 'haml' | |
gem 'hirb', :group => :development | |
gem 'what_methods', :group => :development | |
gem 'rspec-rails', '>= 2.0.0.beta', :group => :test | |
gem 'rr', :group => :test |
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
namespace :locale do | |
desc "print translations" | |
task :translations => :environment do | |
printer = lambda { |hash_or_string, keys = []| | |
case hash_or_string | |
when String | |
puts "#{keys.join('.')} => #{hash_or_string.inspect}" | |
when Hash | |
hash_or_string.keys.sort.each do |key| | |
value = hash_or_string[key] |
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 ActiveRecord::Base | |
# Usage: | |
# | |
# > puts User.first.to_factory_girl | |
# FactoryGirl.define do | |
# factory :user do | |
# ... | |
# end | |
# end | |
# # Usage: FactoryGirl.create(:user, ...) |
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
# see: http://weblog.therealadam.com/2011/02/12/simple-ruby-pleasures/comment-page-1/#comment-315 | |
class QueryTracer < ActiveSupport::LogSubscriber | |
ACCEPT = %r{^(app|config|lib)}.freeze | |
FRAMES = 5 | |
THRESHOLD = 300 # In ms | |
def sql(event) | |
return unless event.duration > THRESHOLD |
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
ActiveRecord::Base.descendants.reject(&:abstract_class?).each do |model| | |
string_or_text_columns = model.columns.select { |column| column.type == :string || column.type == :text } | |
columns_with_maximum_length_validation = model.validators.select {|v| v.is_a? ActiveRecord::Validations::LengthValidator }.select {|v| v.options[:maximum] || v.options[:within] }.map(&:attributes).flatten.uniq | |
string_or_text_columns.each do |column| | |
if columns_with_maximum_length_validation.include?(column.name.to_sym) | |
puts "#{model.name}##{column.name} is OK" | |
else | |
puts "#{model.name}##{column.name} is NG" | |
end | |
end |
https://zverok.space/blog/2022-03-03-WAR.html 翻訳
2022年3月3日
やぁ、僕はVictor Shepelev。ウクライナのハリコフに住んでいて、TwitterやGitHubでは@zverokというIDで活動している。
僕がRubyを書き始めたのは2003年からで、いくつかのライブラリやRuby Changelogのメンテナだ。国際的なカンファレンスや/r/rubyなんかで君たちと会ったことがあるかも知れない。今年、僕はRubyコミッターに申請して、嬉しいことに承認された。僕が取り組んでいるのは(いくつかの小さな機能追加と共に)Rubyドキュメントの改善だ。僕のRubyに関する作業の一覧はここで確認できる。
ruby-jpには大量にチャンネルがあります。 rubyist-istの観点から少し整理してみました。
- [#regional_rb][0]: 地域のRubyist同士の集まり(ミートアップ)に関する話題が中心
- [#rubykaigi][1]: RubyKaigiの話題
- [#rubyworld-conference][2]: 毎年11月に松江で開催されるRubyWorld Conferenceの話題
- Rails 7.0.1 is compatible with Ruby 3.1.0.
- Rails 7.0.1 addes net-smtp, net-imap and net-pop gems as Action Mailbox and Action Mailer dependency, you do not need to add them explicitly in your application Gemfile anymore.
- thor 1.2.1 has been released. You will not see
DidYouMean::SPELL_CHECKERS.merge
deprecate warnings anymore.
- Use Rails 6.1.5 to support
database.yml
with aliases andsecrets.yml
with aliases.
OlderNewer