Skip to content

Instantly share code, notes, and snippets.

View rafaelfranca's full-sized avatar
🚆
Focused on Rails

Rafael Mendonça França rafaelfranca

🚆
Focused on Rails
View GitHub Profile
diff --git a/activerecord/lib/active_record/fixtures.rb b/activerecord/lib/active_record/fixtures.rb
index 4cd5f92..4306b36 100644
--- a/activerecord/lib/active_record/fixtures.rb
+++ b/activerecord/lib/active_record/fixtures.rb
@@ -2,7 +2,7 @@ require 'erb'
require 'yaml'
require 'zlib'
require 'active_support/dependencies'
-require 'active_support/core_ext/securerandom'
+require 'active_support/core_ext/digest/uuid'

Keybase proof

I hereby claim:

  • I am rafaelfranca on github.
  • I am rafaelfranca (https://keybase.io/rafaelfranca) on keybase.
  • I have a public key whose fingerprint is 54FE 550E A35E 26D7 C753 62C1 FC23 B6D0 F1EE E948

To claim this, I am signing this object:

#!/usr/bin/env ruby
require 'bundler'
Bundler.setup
require 'octokit'
require 'active_support'
require 'active_support/core_ext/date/calculations'
require 'active_support/core_ext/numeric/time'
REPOSITORIES = %w(spree/spree)
diff --git a/lib/arel.rb b/lib/arel.rb
index a2a3588..70b46fc 100644
--- a/lib/arel.rb
+++ b/lib/arel.rb
@@ -11,10 +11,6 @@ require 'arel/table'
require 'arel/attributes'
require 'arel/compatibility/wheres'
-#### these are deprecated
-require 'arel/expression'
@rafaelfranca
rafaelfranca / output
Created January 31, 2014 00:11
default_scope on 4.1
-- create_table(:users)
D, [2014-01-30T22:10:52.725995 #81566] DEBUG -- : (0.4ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255))
-> 0.0054s
Run options: --seed 18199
# Running:
D, [2014-01-30T22:10:52.750686 #81566] DEBUG -- : (0.1ms) begin transaction
D, [2014-01-30T22:10:52.753069 #81566] DEBUG -- : SQL (0.1ms) INSERT INTO "users" ("name") VALUES (?) [["name", "Rafael"]]
D, [2014-01-30T22:10:52.753319 #81566] DEBUG -- : (0.0ms) commit transaction
@rafaelfranca
rafaelfranca / output
Created January 31, 2014 00:09
default_scope on 4.0
-- create_table(:users)
D, [2014-01-30T22:08:17.324202 #81447] DEBUG -- : (0.4ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255))
-> 0.0057s
Run options: --seed 58805
# Running tests:
D, [2014-01-30T22:08:17.647532 #81447] DEBUG -- : (0.1ms) begin transaction
D, [2014-01-30T22:08:17.682862 #81447] DEBUG -- : SQL (0.3ms) INSERT INTO "users" ("name") VALUES (?) [["name", "Rafael"]]
D, [2014-01-30T22:08:17.683633 #81447] DEBUG -- : (0.2ms) commit transaction
unless File.exist?('Gemfile')
File.write('Gemfile', <<-GEMFILE)
source 'https://rubygems.org'
gem 'rails', github: 'rails/rails'
gem 'arel', github: 'rails/arel'
gem 'sqlite3'
GEMFILE
system 'bundle'
end
@rafaelfranca
rafaelfranca / deprecation.rb
Last active March 12, 2024 14:33
Examples of `ActiveSupport::Deprecation`
require 'active_support'
class Foo
def foo
"foo"
end
def bar
ActiveSupport::Deprecation.warn("bar is deprecated")
class CurrencyInput < SimpleForm::Inputs::Base

  def input
    input_html_classes.unshift("string currency")
    input_html_options[:type] ||= input_type if html5?

    template.content_tag(:span, "$", class: "add-on") +
    @builder.text_field(attribute_name, input_html_options)
 end