Slide 1

Slide 1 text

@rawpixel on Unsplash

Slide 2

Slide 2 text

Muhammad Mufid Afif https://mufid.github.io

Slide 3

Slide 3 text

@mufid

Slide 4

Slide 4 text

@mufid CATS

Slide 5

Slide 5 text

@mufid Neko Atsume LOLOLOLOL

Slide 6

Slide 6 text

Rails’ing since 2012 Professionally 2015

Slide 7

Slide 7 text

No content

Slide 8

Slide 8 text

SaaS Platform & IoT Devices

Slide 9

Slide 9 text

No content

Slide 10

Slide 10 text

No content

Slide 11

Slide 11 text

@rawpixel on Unsplash

Slide 12

Slide 12 text

@rawpixel on Unsplash

Slide 13

Slide 13 text

No content

Slide 14

Slide 14 text

$ rails console

Slide 15

Slide 15 text

$ rails console Loading development environment (Rails 5.1.4) 2.3.5 :001 > 1+1 => 2

Slide 16

Slide 16 text

$ irb

Slide 17

Slide 17 text

$ irb

Slide 18

Slide 18 text

$ irb 2.3.5 :001 > 1+1 => 2

Slide 19

Slide 19 text

$ irb 2.3.5 :001 > 1+1 => 2 $ rails console Loading development environment (Rails 5.1.4) 2.3.5 :001 > 1+1 => 2

Slide 20

Slide 20 text

$ irb 2.3.5 :001 > 1.days.ago $ rails console Loading development environment (Rails 5.1.4) 2.3.5 :001 > 3.days.ago

Slide 21

Slide 21 text

$ irb 2.3.5 :001 > 1.days.ago NoMethodError: undefined method `days' for 3:Fixnum $ rails console Loading development environment (Rails 5.1.4) 2.3.5 :001 > 3.days.ago => Mon, 25 Jun 2018 09:11:12 UTC +00:00

Slide 22

Slide 22 text

$ irb 2.3.5 :001 > 1.days.ago NoMethodError: undefined method `days' for 3:Fixnum 2.3.5 :002 > require 'active_support/all'

Slide 23

Slide 23 text

$ irb 2.3.5 :001 > 1.days.ago NoMethodError: undefined method `days' for 3:Fixnum 2.3.5 :002 > require 'active_support/all' => true

Slide 24

Slide 24 text

$ irb 2.3.5 :001 > 1.days.ago NoMethodError: undefined method `days' for 3:Fixnum 2.3.5 :002 > require 'active_support/all' => true 2.3.5 :003 > 3.days.ago => 2018-06-25 16:13:24 +0700

Slide 25

Slide 25 text

MOST RAILS MAGIC COMES FROM ACTIVESUPPORT Trivia #1

Slide 26

Slide 26 text

YOU CAN USE ACTIVESUPPORT WITHOUT RAILS Trivia #1

Slide 27

Slide 27 text

No content

Slide 28

Slide 28 text

No content

Slide 29

Slide 29 text

Can you use Rails without ActiveRecord?

Slide 30

Slide 30 text

Can you use Rails without ActiveRecord? Yes

Slide 31

Slide 31 text

Can you use Rails without ActiveRecord? Yes Can you use Rails without ActionCable?

Slide 32

Slide 32 text

Can you use Rails without ActiveRecord? Yes Can you use Rails without ActionCable? Yes

Slide 33

Slide 33 text

Can you use Rails without ActiveRecord? Yes Can you use Rails without ActionCable? Yes Can you use Rails without ActiveStorage?

Slide 34

Slide 34 text

Can you use Rails without ActiveRecord? Yes Can you use Rails without ActionCable? Yes Can you use Rails without ActiveStorage? Yes

Slide 35

Slide 35 text

Can you use Rails without ActiveRecord? Yes Can you use Rails without ActionCable? Yes Can you use Rails without ActiveStorage? Yes Can you use Rails without ActiveJob?

Slide 36

Slide 36 text

Can you use Rails without ActiveRecord? Yes Can you use Rails without ActionCable? Yes Can you use Rails without ActiveStorage? Yes Can you use Rails without ActiveJob? Yes

Slide 37

Slide 37 text

Can you use Rails without ActiveRecord? Yes Can you use Rails without ActionCable? Yes Can you use Rails without ActiveStorage? Yes Can you use Rails without ActiveJob? Yes Can you use Rails without ActiveSupport?

Slide 38

Slide 38 text

Can you use Rails without ActiveRecord? Yes Can you use Rails without ActionCable? Yes Can you use Rails without ActiveStorage? Yes Can you use Rails without ActiveJob? Yes Can you use Rails without ActiveSupport? No

Slide 39

Slide 39 text

actioncable (5.1.4) actionpack (= 5.1.4) nio4r (~> 2.0) websocket-driver (~> 0.6.1)

Slide 40

Slide 40 text

actioncable (5.1.4) actionpack (= 5.1.4) nio4r (~> 2.0) websocket-driver (~> 0.6.1) actionpack (5.1.4) actionview (= 5.1.4) activesupport (= 5.1.4) rack (~> 2.0) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.0.2)

Slide 41

Slide 41 text

actionview (5.1.4) activesupport (= 5.1.4) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.0.3)

Slide 42

Slide 42 text

activejob (5.1.4) activesupport (= 5.1.4) globalid (>= 0.3.6)

Slide 43

Slide 43 text

activemodel (5.1.4) activesupport (= 5.1.4)

Slide 44

Slide 44 text

activerecord (5.1.4) activemodel (= 5.1.4) activesupport (= 5.1.4) arel (~> 8.0)

Slide 45

Slide 45 text

YOU CAN’T USE RAILS WITHOUT ACTIVESUPPORT Trivia #2

Slide 46

Slide 46 text

No content

Slide 47

Slide 47 text

@fancycrave - Unsplash

Slide 48

Slide 48 text

No content

Slide 49

Slide 49 text

> "User".class => String

Slide 50

Slide 50 text

> "User".constantize.class => Class

Slide 51

Slide 51 text

> "User".constantize.find(1) User Load (25.4ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 LIMIT $2 [["id", 1], ["LIMIT", 1]] => #

Slide 52

Slide 52 text

> "User".find(1) User Load (25.4ms) SELECT "users".* FROM "users" WHERE "users"."id" = $1 LIMIT $2 [["id", 1], ["LIMIT", 1]] => #

Slide 53

Slide 53 text

No content

Slide 54

Slide 54 text

ActiveSupport::Notifications

Slide 55

Slide 55 text

ActiveSupport::Notifications Built-in pub sub for those who doesn’t need ActionCable

Slide 56

Slide 56 text

ActiveSupport::Notifications Built-in pub sub for those who doesn’t need ActionCable Instrumentation

Slide 57

Slide 57 text

ActiveSupport::Notifications.subscribe "deliver.action_mailer" do |*args| event = ActiveSupport::Notifications::Event.new(*args) tags = { mailer: event.payload[:mailer] } collector.increment "rails.mail.sent", tags: tags, inherit_tags: true end

Slide 58

Slide 58 text

Librato Gem

Slide 59

Slide 59 text

Action Controller write_fragment.action_controller read_fragment.action_controller expire_fragment.action_controller exist_fragment?.action_controller write_page.action_controller expire_page.action_controller start_processing.action_controller process_action.action_controller send_file.action_controller send_data.action_controller redirect_to.action_controller halted_callback.action_controller unpermitted_parameters.action_controller Action View render_template.action_view render_partial.action_view render_collection.action_view Active Record sql.active_record instantiation.active_record

Slide 60

Slide 60 text

Action Mailer receive.action_mailer deliver.action_mailer process.action_mailer Active Support cache_read.active_support cache_generate.active_support cache_fetch_hit.active_support cache_write.active_support cache_delete.active_support cache_exist?.active_support Active Job enqueue_at.active_job enqueue.active_job perform_start.active_job perform.active_job Action Cable perform_action.action_cable transmit.action_cable transmit_subscription_confirmation.action_cable transmit_subscription_rejection.action_cable broadcast.action_cable

Slide 61

Slide 61 text

Active Storage service_upload.active_storage service_streaming_download.active_storage service_download.active_storage service_delete.active_storage service_delete_prefixed.active_storage service_exist.active_storage service_url.active_storage Railties load_config_initializer.railties

Slide 62

Slide 62 text

No content

Slide 63

Slide 63 text

A LOT of features

Slide 64

Slide 64 text

No content

Slide 65

Slide 65 text

No content

Slide 66

Slide 66 text

No content

Slide 67

Slide 67 text

No content

Slide 68

Slide 68 text

No content

Slide 69

Slide 69 text

No content

Slide 70

Slide 70 text

Omakase

Slide 71

Slide 71 text

MIT License! Copy anything you want Copy anything you need

Slide 72

Slide 72 text

Don’t waste your time What you need might have been covered in ActiveSupport

Slide 73

Slide 73 text

That’s All!

Slide 74

Slide 74 text

THANKYOU NO Q&A but let’s talk on the SOURCE CODE AND SLIDE: SPEAKERDECK.COM/MUFID i am mufid let’s make software, better, together! mail me privately at [email protected] or tweet publicly to me to @mufid

Slide 75

Slide 75 text

AgileCampus.org Training Depok, Jawa Barat August/September 2018

Slide 76

Slide 76 text

THANKYOU NO Q&A but let’s talk on the SOURCE CODE AND SLIDE: SPEAKERDECK.COM/MUFID i am mufid let’s make software, better, together! mail me privately at [email protected] or tweet publicly to me to @mufid

Slide 77

Slide 77 text

thanks! see you later that is my vCard