Explore tweets tagged as #ActiveSupport
One of the reasons I enjoy using Ruby on Rails is because it has a lot of niceties like `ActiveSupport::StringInquirer`:
3
11
108
Today's #rails tip is about `ActiveSupport::Configurable`. It is useful for adding configuration options to your classes or modules, It is exactly similar to how Rails is configured.
0
1
12
Create a powerful Reset-to-Default pattern using: ➡️ ActiveSupport::Concern ➡️ ActiveRecord::ModelSchema.column_defaults ➡️ and the lesser-known `attribute_method_affix` #rubyonrails
1
6
49
Have you ever wondered, how ActiveSupport::Concern works? `append_features` is a core #ruby method and it's where module inclusion actually happens. You can break `include` if you override `append_features` ActiveSupport::Concern overrides `append_features` and does good things
1
8
36
💎 Ruby protip: Sometimes you need to check if a value is in an array and return the value if so. ActiveSupport adds `presence_in` so you can do exactly this instead of using a conditional. #ruby #rails #rubyonrails
4
17
180
TIL about ActiveSupport::Gzip. I was looking for a way to compress an API request body client side and decompress server side. I found the pure ruby way (which is much longer) but was pleasantly surprised that the pattern is wrapped up in Active Support. The pure ruby way is:
5
6
81
What is your favorite Ruby/Rails method? Mine is probably `compact_blank` in ActiveSupport If removes all `blank?` values from arrays and hashes so you can confidently chain additional collection methods
17
18
187
pogocache-ruby - A faster, more lightweight alternative to ActiveSupport::Cache::MemoryStore Uses the pogocache.c embedded library 🚀 https://t.co/OZzMa2Jn1h
1
4
21
Rails ships with `Rails.backtrace_cleaner` (powered by ActiveSupport::BacktraceCleaner). Use it in an initializer to hide gem noise and shorten paths. 💚 #rubyonrails
2
8
66
#Rails ActiveSupport's delegate method is handy for delegating method calls to another object. Did you know that this works well for Plain Ruby objects also? #Ruby #tip #TipOfTheDay
1
0
4
#Rails Tip ActiveSupport::Inflector provides various methods to transform strings in various ways, which can be very handy for handling text and generating dynamic content. Knowing about the inflector can be handy. It saves time and improves readability. https://t.co/g6QZaDkwy3
0
1
4
Rails 7.1 から ActiveSupport::MessageVerifier のシリアライザーについて、Marshal が非推奨になって ActiveSupport::JSON がデフォルト(推奨)になった
2
0
2
🚀 @_byroot just made Rails inflections up to 150% faster! Clever refactor of ActiveSupport's pluralize/singularize system, and fast-pathed English locale. This speeds up every app by default 💨 https://t.co/m9YU8YLeYU
#RubyOnRails #Performance #ruby
2
3
82
ActiveSupport::MessageVerifier is really neat but I was surprised that we need to provide the secret and it didn't default to one of the Rails secrets. Any ideas?
4
2
12
It doesn't matter which JSON serializer you use, because your serializer is not your bottleneck. This is from a 2 second long response (fixing a bug!). Time spent in OJ itself? Less than 1 millisecond. I'm spending 150x that just in ActiveSupport messing around with BigDecimal.
5
1
54
TIL about the ActiveSupport `mattr_accessor` method. It defines both class and instance accessors for class attributes. Handy little shortcut! 🔧 #ruby #rubyonrails
2
0
32
Did you know Rails has a `halted_callback_hook` that runs every time a `before_*` callback is halted? 🤩 Perfect for logging or debugging! #rubyonrails #activesupport
1
14
85
All kinds of fun to be had with ActiveSupport::Notifications in Rails
0
1
39