Consider a simple HTML element that we want to expand and contract by tapping a different target element.
<a href='expandable-element-1' data-expander>
<!-- some link markup styled using an `expanded` class -->
</a>
The following items have made the biggest difference in our lives, with respect to day-to-day finances. Some are obvious, some maybe not so! In order of impact:
Budgeting used to feel like a chore that created feelings of "lack". Over time, we've learned how to view budgeting as a reflection of how our family wants to be spending money, rather than how we're limited in our spending. That, in addition to the rest of these items, helps us feel in the driver's seat financially, with flexibility and joy. The keys here for us here are shown in this spreadsheet and are, namely:
=> Rack::Timeout set to 1800 in development
Loading development environment (Rails 4.2.4)
[1] pry(main)> CassandraMigrations::Cassandra.client
=> #<Client:0x007ff17f6755e8
@cluster=#<Cassandra::Cluster:0x3ff8bf4fc660>,
@session=#<Cassandra::Session:0x3ff8bfb42574>,
@sessions={:default=>#, "timebomb_api_development"=>#}>
It can be difficult to test the different scenarious for a module intended for use by including in another class.
If the class is statically defined in the spec, any later definitions extend, not replace, the first definition - which can cause test issues and breaks isolation between examples.
RSpec.describe SomeModule do
class SomeIncluder
include SomeModule
end
irb(main):001:0> module A
irb(main):002:1> def sound_off
irb(main):003:2> puts 'module a'
irb(main):004:2> end
irb(main):005:1> end
=> nil
irb(main):006:0>
irb(main):007:0* module B
irb(main):008:1> def sound_off
module ErrorsWithTypesExtensions
attr_reader :types
# Pass in the instance of the object that is using the errors object.
#
# class Person
# def initialize
# @errors = ActiveModel::Errors.new(self)
# end
I love the concept and usability of an ActiveModel::Errors paradigm. However, I and others often find it frustrating to work with the implementation.
I'd love to see a proper ActiveModel::Error
object, where the errors attribute of a model including ActiveModel::Errors was an Enumerator of these objects.
There are various implied benefits and added flexibility that could be introduced in a backwards compatible way later, and immedate benefits.
# Serializing 1 string attribute, 1 overriden uuid.to_s attribute, | |
# and 1 empty array, 30 times. | |
# bmbm: | |
# user system total real | |
# serializer 0.010000 0.000000 0.010000 ( 0.002572) | |
# delegator 0.000000 0.000000 0.000000 ( 0.000424) | |
# ips: | |
# delegator: 3600.6 i/s | |
# serializer: 427.6 i/s - 8.42x slower |
class Test
def foo(value=default_value)
value
end
def default_value
'default'
end