fragmentary 0.2.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ce71afcd11d78930295c8839ee9519b2bb504f40
4
- data.tar.gz: 354eee986e23c365e958807f3024ebb571e6b7e8
3
+ metadata.gz: 2747ef223962cc8eaa11b9d929febf77a5746bca
4
+ data.tar.gz: 8eb6ca9f3d487102cf23bb8944f46a856230371c
5
5
  SHA512:
6
- metadata.gz: cecfed68ceed46c1d174c5f967769ae4c6bc9608f09675e3d693958c931be25e8adaf58c497755197549e83959756a14e67e4cf50fd52cd58ac9b1e5cfe31c6e
7
- data.tar.gz: fb4fca48abf783d5fd7faa24147b4c55164444341c21bdf936107562cf112fef55a183f34855bf42076bf8bc3a747ece32f1d61d818bd3e507b7411610163d3c
6
+ metadata.gz: dcf5246ca4dd67f075f74b7d951e6e69d57dce8269ed49e6896cb92d45e2079500317345e95bb63208d7035e9988f6c03ff653eab2d88c410bfe6de3a9509b99
7
+ data.tar.gz: f0498b8f900c03dc05d0469fbf5cde755b91b7a941da85cfc9394c5d730cc40ab9f097a4e2e1c38bc73e62700cc0bf83d0360233fb6e5d580dd9984b45b2a527
@@ -1,3 +1,6 @@
1
+ ### 0.2.2
2
+ - Removes validation of the fragment's root_id (only relevant to child fragments); ignore v0.2.1
3
+
1
4
  ### 0.2.1
2
5
  - Fixes a syntax bug in validating a fragment's root_id
3
6
  - Adds README documentation on the use of methods for explicitly retreving user-dependent fragments.
@@ -28,9 +28,10 @@ module Fragmentary
28
28
 
29
29
  attr_accessor :indexed_children
30
30
 
31
- validates :root_id, :presence => true
32
-
33
- self.cache_timestamp_format = :usec # Probably not needed for Rails 5, which uses :usec by default.
31
+ # Set cache timestamp format to :usec instead of :nsec because the latter is greater precision than Postgres supports,
32
+ # resulting in mismatches between timestamps on a newly created fragment and one retrieved from the database.
33
+ # Probably not needed for Rails 5, which uses :usec by default.
34
+ self.cache_timestamp_format = :usec
34
35
 
35
36
  end
36
37
 
@@ -146,7 +147,7 @@ module Fragmentary
146
147
  # create or retrieve a Fragment of that class. A user_id is needed for example when caching user-specific content
147
148
  # such as a user profile. When the fragment is instantiated using FragmentsHelper methods 'cache_fragment' or
148
149
  # 'CacheBuilder.cache_child', a :user option is added to the options hash automatically from the value of 'current_user'.
149
- # The user_id is extracted from this option in Fragment.find_or_create.
150
+ # The user_id is extracted from this option in Fragment.attributes.
150
151
  def needs_user_id
151
152
  self.extend NeedsUserId
152
153
  end
@@ -156,7 +157,7 @@ module Fragmentary
156
157
  # differently depending on the type of user, e.g. to distinguish between content seen by signed in users and those not
157
158
  # signed in. When the fragment is instantiated using FragmentsHelper methods 'cache_fragment' or 'CacheBuilder.cache_child',
158
159
  # a :user option is added to the options hash automatically from the value of 'current_user'. The user_type is extracted
159
- # from this option in Fragment.find_or_create.
160
+ # from this option in Fragment.attributes.
160
161
  def needs_user_type(options = {})
161
162
  self.extend NeedsUserType
162
163
  instance_eval do
@@ -1,3 +1,3 @@
1
1
  module Fragmentary
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fragmentary
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Thomson