Skip to content

Commit

Permalink
Shortened the blurb on serialization scope issues.
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Davey committed Nov 28, 2011
1 parent 63e87df commit cf9c5f6
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions lib/methods/serialize.rb
Expand Up @@ -48,9 +48,8 @@ def initialize(base, column_name, options)


base.send :private, :make_default_roles base.send :private, :make_default_roles



# Scopes:
# Scopes (Ugly, no cross-table query support, potentially unsafe. Fix?) # ---------
# ----------------------------------------------------------------------------------------------------
# For security, wrapping markers must be included in the LIKE search, otherwise a user with # For security, wrapping markers must be included in the LIKE search, otherwise a user with
# role 'administrator' would erroneously be included in `User.with_scope('admin')`. # role 'administrator' would erroneously be included in `User.with_scope('admin')`.
# #
Expand All @@ -61,12 +60,9 @@ def initialize(base, column_name, options)
# the '!' character. # the '!' character.
# #
# An alternative would be to use JSON instead of YAML to serialize the data, but I've wrestled # An alternative would be to use JSON instead of YAML to serialize the data, but I've wrestled
# countless SerializationTypeMismatch errors trying to accomplish this, in vain. # countless SerializationTypeMismatch errors trying to accomplish this, in vain. The real problem, of course,
# # is even trying to query serialized data. I'm unsure how well this would work in different ruby versions or
# Adding a dependancy to something like Squeel would allow for cleaner syntax in the `where()`, with the # implementations, which may handle object dumping differently. Bitmasking seems to be a more reliable strategy.
# added bonus of supporting complex cross-table queries. The real problem, of course, is even trying to
# query serialized data. I'm unsure how well this would work in different ruby versions or implementations,
# which may handle object dumping differently.


base.class_eval do base.class_eval do
const_set :ROLES_MARKER, '!' const_set :ROLES_MARKER, '!'
Expand Down

0 comments on commit cf9c5f6

Please sign in to comment.