hyper-mesh 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +59 -204
  3. data/config/routes.rb +1 -1
  4. data/docs/action_cable_quickstart.md +13 -36
  5. data/docs/configuration_details.md +62 -0
  6. data/docs/pusher_faker_quickstart.md +28 -0
  7. data/docs/pusher_quickstart.md +17 -0
  8. data/docs/simple_poller_quickstart.md +5 -0
  9. data/examples/words/Gemfile +4 -3
  10. data/examples/words/Gemfile.lock +33 -32
  11. data/examples/words/app/views/components.rb +4 -2
  12. data/examples/words/config/initializers/hyper_mesh.rb +14 -0
  13. data/examples/words/config/routes.rb +1 -1
  14. data/hyper-mesh-0.4.0.gem +0 -0
  15. data/lib/hyper-mesh.rb +2 -1
  16. data/lib/hypermesh/version.rb +1 -1
  17. data/lib/reactive_record/active_record/public_columns_hash.rb +2 -2
  18. data/lib/reactive_record/active_record/reactive_record/isomorphic_base.rb +1 -1
  19. data/lib/reactive_record/engine.rb +2 -4
  20. data/lib/reactive_record/permissions.rb +30 -7
  21. data/lib/synchromesh/client_drivers.rb +3 -5
  22. data/lib/synchromesh/connection.rb +34 -8
  23. data/lib/synchromesh/synchromesh.rb +11 -7
  24. data/lib/synchromesh/synchromesh_controller.rb +9 -1
  25. data/path_release_steps.md +9 -0
  26. data/reactive_record_test_app/Gemfile +2 -1
  27. data/reactive_record_test_app/Gemfile.lock +6 -6
  28. data/reactive_record_test_app/config/application.rb +0 -1
  29. data/reactive_record_test_app/config/initializers/hyper_mesh_legacy_behavior.rb +5 -0
  30. data/reactive_record_test_app/config/routes.rb +3 -3
  31. data/spec/reactive_record/edge_cases_spec.rb +1 -1
  32. data/spec/reactive_record/many_to_many_spec.rb +1 -1
  33. data/spec/reactive_record/revert_spec.rb +1 -0
  34. data/spec/reactive_record/update_associations_spec.rb +1 -0
  35. data/spec/reactive_record/update_scopes_spec.rb +1 -0
  36. data/spec/synchromesh/crud_access_regulation/broadcast_controls_access_spec.rb +0 -6
  37. data/spec/synchromesh/crud_access_regulation/model_policies_spec.rb +8 -6
  38. data/spec/synchromesh/integration/has_many_through_spec.rb +0 -4
  39. data/spec/test_app/config/routes.rb +1 -1
  40. data/work-in-progress-drinking.png +0 -0
  41. metadata +8 -4
  42. data/examples/words/config/initializers/synchromesh.rb +0 -5
  43. data/lib/synchromesh/reactive_record/permission_patches.rb +0 -43
@@ -1,5 +0,0 @@
1
- #config/initializers/synchromesh.rb
2
- HyperMesh.configuration do |config|
3
- config.transport = :action_cable
4
- config.channel_prefix = "synchromesh"
5
- end
@@ -1,43 +0,0 @@
1
- # acting user is the acting user... okay
2
-
3
- class ActiveRecord::Base
4
-
5
- def view_permitted?(attribute)
6
- HyperMesh::InternalPolicy.accessible_attributes_for(self, acting_user).include? attribute.to_sym
7
- end
8
-
9
- def create_permitted?
10
- false
11
- end
12
-
13
- def update_permitted?
14
- false
15
- end
16
-
17
- def destroy_permitted?
18
- false
19
- end
20
- end
21
-
22
- module HyperMesh
23
- class InternalPolicy
24
-
25
- def self.accessible_attributes_for(model, acting_user)
26
- user_channels = ClassConnectionRegulation.connections_for(acting_user, false) +
27
- InstanceConnectionRegulation.connections_for(acting_user, false)
28
- internal_policy = InternalPolicy.new(model, model.attribute_names, user_channels)
29
- ChannelBroadcastRegulation.broadcast(internal_policy)
30
- InstanceBroadcastRegulation.broadcast(model, internal_policy)
31
- internal_policy.accessible_attributes_for
32
- end
33
-
34
- def accessible_attributes_for
35
- accessible_attributes = Set.new
36
- @channel_sets.each do |channel, attribute_set|
37
- accessible_attributes.merge attribute_set
38
- end
39
- accessible_attributes << :id unless accessible_attributes.empty?
40
- accessible_attributes
41
- end
42
- end
43
- end