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 +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/fragmentary/fragment.rb +6 -5
- data/lib/fragmentary/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2747ef223962cc8eaa11b9d929febf77a5746bca
|
4
|
+
data.tar.gz: 8eb6ca9f3d487102cf23bb8944f46a856230371c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dcf5246ca4dd67f075f74b7d951e6e69d57dce8269ed49e6896cb92d45e2079500317345e95bb63208d7035e9988f6c03ff653eab2d88c410bfe6de3a9509b99
|
7
|
+
data.tar.gz: f0498b8f900c03dc05d0469fbf5cde755b91b7a941da85cfc9394c5d730cc40ab9f097a4e2e1c38bc73e62700cc0bf83d0360233fb6e5d580dd9984b45b2a527
|
data/CHANGELOG.md
CHANGED
@@ -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.
|
data/lib/fragmentary/fragment.rb
CHANGED
@@ -28,9 +28,10 @@ module Fragmentary
|
|
28
28
|
|
29
29
|
attr_accessor :indexed_children
|
30
30
|
|
31
|
-
|
32
|
-
|
33
|
-
|
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.
|
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.
|
160
|
+
# from this option in Fragment.attributes.
|
160
161
|
def needs_user_type(options = {})
|
161
162
|
self.extend NeedsUserType
|
162
163
|
instance_eval do
|
data/lib/fragmentary/version.rb
CHANGED