Tag: rails

  • Multiple Postgres Schemas and Rails db:test:prepare

    In our Rails databases, we use multiple Postgres schemas. This is partly for partitioning archive data from fresh data. On a new Rails 5 project, I started having tests fail once the models had the “archivable” concern added, which depended on an archive schema existing. Ultimately, the problem is that the archive schema wasn’t being…

  • RailsSettings vs parallel_tests

    RailsSetting stubbing problem I have an area of functionality that is controlled by a Settings class that is a subclass of RailsSettings::CachedSettings (rails-settings-cached gem) and changing that setting for tests was interfering with the parallel_tests gem when I ran my rspec tests. I tried namespacing the cache, making TTL 0, invalidating the cache, monkeypatching the…

  • Rails 4, phantom ArgumentError: wrong number of arguments (0 for 1) on UserSession.find for AuthLogic

    This was a total pain to locate, as the exceptions being raised were pointed to UserSession.find in Authlogic::Session::Persistence. gems in question: activerecord-session_store 0.1.1 authlogic 3.4.6 activerecord 4.2.3 rails 4.2.3 I noticed that the only meaningful difference between the two environments was the following instance variable in Rails.application.config: irb> pp Rails.application.config . . . @logger= #…