All Versions
26
Latest Version
Avg Release Cycle
62 days
Latest Release
2783 days ago

Changelog History
Page 3

  • v0.4.3 Changes

    • Made Mapper#load_association! more friendly. It now loads the associated objects for all objects passed in and works with arrays of referenced objects.
    • ⚑️ Mapper#load_association! is also now more efficient β€”Β the N+1 queries have been optimized. The number of queries it fires off is now equal to the quantity of different classes of associated objects.
      • For example, if a user can have either a UserProfile or an AdminProfile as its profile attribute, Perpetuity will use two queries in #load_association! if and only if both types of profiles are used.
      • In that example, if you only query users with a UserProfile, only one DB query will be triggered.

    πŸ†• New query example:

    user_mapper = Perpetuity[User]
    users = user_mapper.all.to_a
    user_mapper.load_association! users, :profile
    

    Each of the users in the DB will have their profiles loaded with a single DB query per profile type and stored in their profile attributes.

  • v0.4.2 Changes

    • πŸ‘Œ Improved speed and stability of Mapper#first and Mapper#all
  • v0.4.1 Changes

    • βž• Add Mapper#remove_index! to remove DB indexes
    • πŸ›  Fix index declarations in mappers to take unique/order options
      • These were intended to be there from the beginning, but the API wasn't made available in the mapper
  • v0.4 Changes

    • Mapper select DSL now more closely resembles Enumerable syntax
      • Instead of mapper.select { published_at < Time.now } you would write mapper.select { |article| article.published_at < Time.now }
      • It's a little more typing, but it eliminates a lot of problems that came from calling instance_exec on the block. It meant we couldn't call methods on the current object (they would be invoked on the Query object) or use instance variables from the current object.
      • Explained more in issue #19
  • v0.3.1 Changes

    • Access object state via instance methods to store actual object state, rather than treating all objects as value objects
    • πŸ‘‰ Use Object.allocate rather than Object.new when restoring state to an object from the database
  • v0.3 Changes

    • πŸ‘‰ Use Perpetuity[] instead of Perpetuity::Mapper[] to get mapper instances
    • πŸ‘ Allow subclassing of Perpetuity::Mapper with map macro
    • πŸ›  Fix select calls using id as criteria from returning invalid or missing data
    • πŸ‘‰ Make MongoDB reads and writes fail fast
    • βž• Add indexing API to mappers
    • πŸ‘» Raise an exception when calling Perpetuity[] with a class that has no mapper
    • βž• Add unions and intersections to select queries for MongoDB adapter
      • This allows for queries like Perpetuity[Article].select { (created_at < Time.now) & (published == true) }
    • ⚑️ Update object in memory when calling Mapper#update
    • βž• Add Mapper#save to update an object's current state in the DB. Previously, we only had #update (primarily for update actions in Rails controllers).
    • ⚠ Silenced some ugly warnings

    πŸ”– Version 0.2 and 0.1 have no changelog because I am a terrible developer