hyper-mesh 0.6.0 → 1.0.0.lap22
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +12 -4
- data/.travis.yml +25 -2
- data/DOCS.md +722 -0
- data/Gemfile +2 -8
- data/README.md +32 -264
- data/Rakefile +7 -5
- data/dciy.toml +3 -0
- data/hyper-mesh.gemspec +59 -81
- data/lib/active_record_base.rb +3 -3
- data/lib/hypermesh/version.rb +1 -1
- data/lib/opal/parse_patch.rb +1 -1
- data/lib/reactive_record/active_record/aggregations.rb +1 -1
- data/lib/reactive_record/active_record/associations.rb +1 -5
- data/lib/reactive_record/active_record/class_methods.rb +6 -23
- data/lib/reactive_record/active_record/instance_methods.rb +30 -10
- data/lib/reactive_record/active_record/public_columns_hash.rb +27 -8
- data/lib/reactive_record/active_record/reactive_record/collection.rb +1 -1
- data/lib/reactive_record/active_record/reactive_record/column_types.rb +7 -1
- data/lib/reactive_record/active_record/reactive_record/dummy_value.rb +28 -15
- data/lib/reactive_record/active_record/reactive_record/isomorphic_base.rb +23 -12
- data/lib/reactive_record/active_record/reactive_record/while_loading.rb +84 -53
- data/lib/reactive_record/engine.rb +1 -1
- data/lib/reactive_record/server_data_cache.rb +99 -44
- metadata +101 -984
- data/docs/action_cable_quickstart.md +0 -134
- data/docs/activerecord_api.md +0 -275
- data/docs/authorization-policies.md +0 -502
- data/docs/client_side_scoping.md +0 -103
- data/docs/configuration_details.md +0 -33
- data/docs/pusher_faker_quickstart.md +0 -56
- data/docs/pusher_quickstart.md +0 -44
- data/docs/simple_poller_quickstart.md +0 -31
- data/docs/todo-example.md +0 -118
- data/docs/word_game.md +0 -28
- data/docs/words-example.md +0 -67
- data/examples/action-cable-production-mode/.gitignore +0 -21
- data/examples/action-cable-production-mode/Gemfile +0 -57
- data/examples/action-cable-production-mode/Gemfile.lock +0 -231
- data/examples/action-cable-production-mode/README.md +0 -24
- data/examples/action-cable-production-mode/Rakefile +0 -6
- data/examples/action-cable-production-mode/app/assets/config/manifest.js +0 -3
- data/examples/action-cable-production-mode/app/assets/images/.keep +0 -0
- data/examples/action-cable-production-mode/app/assets/javascripts/application.js +0 -20
- data/examples/action-cable-production-mode/app/assets/javascripts/cable.js +0 -13
- data/examples/action-cable-production-mode/app/assets/javascripts/channels/.keep +0 -0
- data/examples/action-cable-production-mode/app/assets/stylesheets/application.css +0 -15
- data/examples/action-cable-production-mode/app/channels/application_cable/channel.rb +0 -4
- data/examples/action-cable-production-mode/app/channels/application_cable/connection.rb +0 -4
- data/examples/action-cable-production-mode/app/controllers/application_controller.rb +0 -3
- data/examples/action-cable-production-mode/app/controllers/test_controller.rb +0 -5
- data/examples/action-cable-production-mode/app/models/models.rb +0 -2
- data/examples/action-cable-production-mode/app/models/public/application_record.rb +0 -3
- data/examples/action-cable-production-mode/app/models/public/word.rb +0 -2
- data/examples/action-cable-production-mode/app/policies/application_policy.rb +0 -14
- data/examples/action-cable-production-mode/app/views/components.rb +0 -16
- data/examples/action-cable-production-mode/app/views/components/app.rb +0 -18
- data/examples/action-cable-production-mode/app/views/layouts/application.html.erb +0 -14
- data/examples/action-cable-production-mode/bin/bundle +0 -3
- data/examples/action-cable-production-mode/bin/rails +0 -9
- data/examples/action-cable-production-mode/bin/rake +0 -9
- data/examples/action-cable-production-mode/bin/setup +0 -34
- data/examples/action-cable-production-mode/bin/spring +0 -16
- data/examples/action-cable-production-mode/bin/update +0 -29
- data/examples/action-cable-production-mode/config.ru +0 -5
- data/examples/action-cable-production-mode/config/application.rb +0 -18
- data/examples/action-cable-production-mode/config/boot.rb +0 -3
- data/examples/action-cable-production-mode/config/cable.yml +0 -9
- data/examples/action-cable-production-mode/config/database.yml +0 -25
- data/examples/action-cable-production-mode/config/environment.rb +0 -5
- data/examples/action-cable-production-mode/config/environments/development.rb +0 -56
- data/examples/action-cable-production-mode/config/environments/production.rb +0 -89
- data/examples/action-cable-production-mode/config/environments/test.rb +0 -42
- data/examples/action-cable-production-mode/config/initializers/application_controller_renderer.rb +0 -6
- data/examples/action-cable-production-mode/config/initializers/assets.rb +0 -11
- data/examples/action-cable-production-mode/config/initializers/backtrace_silencers.rb +0 -7
- data/examples/action-cable-production-mode/config/initializers/cookies_serializer.rb +0 -5
- data/examples/action-cable-production-mode/config/initializers/filter_parameter_logging.rb +0 -4
- data/examples/action-cable-production-mode/config/initializers/hyper_mesh.rb +0 -4
- data/examples/action-cable-production-mode/config/initializers/inflections.rb +0 -16
- data/examples/action-cable-production-mode/config/initializers/mime_types.rb +0 -4
- data/examples/action-cable-production-mode/config/initializers/new_framework_defaults.rb +0 -24
- data/examples/action-cable-production-mode/config/initializers/session_store.rb +0 -3
- data/examples/action-cable-production-mode/config/initializers/wrap_parameters.rb +0 -14
- data/examples/action-cable-production-mode/config/locales/en.yml +0 -23
- data/examples/action-cable-production-mode/config/puma.rb +0 -47
- data/examples/action-cable-production-mode/config/routes.rb +0 -5
- data/examples/action-cable-production-mode/config/secrets.yml +0 -22
- data/examples/action-cable-production-mode/config/spring.rb +0 -6
- data/examples/action-cable-production-mode/db/migrate/20161114213840_create_words.rb +0 -9
- data/examples/action-cable-production-mode/db/schema.rb +0 -34
- data/examples/action-cable-production-mode/db/seeds.rb +0 -7
- data/examples/action-cable-production-mode/lib/assets/.keep +0 -0
- data/examples/action-cable-production-mode/lib/tasks/.keep +0 -0
- data/examples/action-cable-production-mode/public/404.html +0 -67
- data/examples/action-cable-production-mode/public/422.html +0 -67
- data/examples/action-cable-production-mode/public/500.html +0 -66
- data/examples/action-cable-production-mode/public/apple-touch-icon-precomposed.png +0 -0
- data/examples/action-cable-production-mode/public/apple-touch-icon.png +0 -0
- data/examples/action-cable-production-mode/public/assets/.sprockets-manifest-3e9abd3ee8ba47c39a55b61ae37ed9e1.json +0 -1
- data/examples/action-cable-production-mode/public/favicon.ico +0 -0
- data/examples/action-cable-production-mode/public/robots.txt +0 -5
- data/examples/action-cable-production-mode/test/controllers/.keep +0 -0
- data/examples/action-cable-production-mode/test/fixtures/.keep +0 -0
- data/examples/action-cable-production-mode/test/fixtures/files/.keep +0 -0
- data/examples/action-cable-production-mode/test/fixtures/words.yml +0 -7
- data/examples/action-cable-production-mode/test/helpers/.keep +0 -0
- data/examples/action-cable-production-mode/test/integration/.keep +0 -0
- data/examples/action-cable-production-mode/test/mailers/.keep +0 -0
- data/examples/action-cable-production-mode/test/models/.keep +0 -0
- data/examples/action-cable-production-mode/test/models/word_test.rb +0 -7
- data/examples/action-cable-production-mode/test/test_helper.rb +0 -10
- data/examples/action-cable-production-mode/vendor/assets/javascripts/.keep +0 -0
- data/examples/action-cable-production-mode/vendor/assets/stylesheets/.keep +0 -0
- data/examples/action-cable/.gitignore +0 -21
- data/examples/action-cable/Gemfile +0 -58
- data/examples/action-cable/Gemfile.lock +0 -248
- data/examples/action-cable/README.md +0 -24
- data/examples/action-cable/Rakefile +0 -6
- data/examples/action-cable/app/assets/config/manifest.js +0 -3
- data/examples/action-cable/app/assets/images/.keep +0 -0
- data/examples/action-cable/app/assets/javascripts/application.js +0 -20
- data/examples/action-cable/app/assets/javascripts/cable.js +0 -13
- data/examples/action-cable/app/assets/javascripts/channels/.keep +0 -0
- data/examples/action-cable/app/assets/stylesheets/application.css +0 -15
- data/examples/action-cable/app/channels/application_cable/channel.rb +0 -4
- data/examples/action-cable/app/channels/application_cable/connection.rb +0 -4
- data/examples/action-cable/app/controllers/application_controller.rb +0 -3
- data/examples/action-cable/app/controllers/test_controller.rb +0 -5
- data/examples/action-cable/app/models/models.rb +0 -2
- data/examples/action-cable/app/models/public/.keep +0 -0
- data/examples/action-cable/app/models/public/application_record.rb +0 -3
- data/examples/action-cable/app/models/public/word.rb +0 -2
- data/examples/action-cable/app/policies/application_policy.rb +0 -14
- data/examples/action-cable/app/views/components.rb +0 -16
- data/examples/action-cable/app/views/components/app.rb +0 -18
- data/examples/action-cable/app/views/layouts/application.html.erb +0 -14
- data/examples/action-cable/bin/bundle +0 -3
- data/examples/action-cable/bin/rails +0 -9
- data/examples/action-cable/bin/rake +0 -9
- data/examples/action-cable/bin/setup +0 -34
- data/examples/action-cable/bin/spring +0 -16
- data/examples/action-cable/bin/update +0 -29
- data/examples/action-cable/config.ru +0 -5
- data/examples/action-cable/config/application.rb +0 -20
- data/examples/action-cable/config/boot.rb +0 -3
- data/examples/action-cable/config/cable.yml +0 -9
- data/examples/action-cable/config/database.yml +0 -25
- data/examples/action-cable/config/environment.rb +0 -5
- data/examples/action-cable/config/environments/development.rb +0 -56
- data/examples/action-cable/config/environments/production.rb +0 -86
- data/examples/action-cable/config/environments/test.rb +0 -42
- data/examples/action-cable/config/initializers/application_controller_renderer.rb +0 -6
- data/examples/action-cable/config/initializers/assets.rb +0 -11
- data/examples/action-cable/config/initializers/backtrace_silencers.rb +0 -7
- data/examples/action-cable/config/initializers/cookies_serializer.rb +0 -5
- data/examples/action-cable/config/initializers/filter_parameter_logging.rb +0 -4
- data/examples/action-cable/config/initializers/hyperloop.rb +0 -4
- data/examples/action-cable/config/initializers/inflections.rb +0 -16
- data/examples/action-cable/config/initializers/mime_types.rb +0 -4
- data/examples/action-cable/config/initializers/new_framework_defaults.rb +0 -24
- data/examples/action-cable/config/initializers/session_store.rb +0 -3
- data/examples/action-cable/config/initializers/wrap_parameters.rb +0 -14
- data/examples/action-cable/config/locales/en.yml +0 -23
- data/examples/action-cable/config/puma.rb +0 -47
- data/examples/action-cable/config/routes.rb +0 -5
- data/examples/action-cable/config/secrets.yml +0 -22
- data/examples/action-cable/config/spring.rb +0 -6
- data/examples/action-cable/db/migrate/20161114213840_create_words.rb +0 -9
- data/examples/action-cable/db/schema.rb +0 -34
- data/examples/action-cable/db/seeds.rb +0 -7
- data/examples/action-cable/lib/assets/.keep +0 -0
- data/examples/action-cable/lib/tasks/.keep +0 -0
- data/examples/action-cable/public/404.html +0 -67
- data/examples/action-cable/public/422.html +0 -67
- data/examples/action-cable/public/500.html +0 -66
- data/examples/action-cable/public/apple-touch-icon-precomposed.png +0 -0
- data/examples/action-cable/public/apple-touch-icon.png +0 -0
- data/examples/action-cable/public/favicon.ico +0 -0
- data/examples/action-cable/public/robots.txt +0 -5
- data/examples/action-cable/test/controllers/.keep +0 -0
- data/examples/action-cable/test/fixtures/.keep +0 -0
- data/examples/action-cable/test/fixtures/files/.keep +0 -0
- data/examples/action-cable/test/fixtures/words.yml +0 -7
- data/examples/action-cable/test/helpers/.keep +0 -0
- data/examples/action-cable/test/integration/.keep +0 -0
- data/examples/action-cable/test/mailers/.keep +0 -0
- data/examples/action-cable/test/models/.keep +0 -0
- data/examples/action-cable/test/models/word_test.rb +0 -7
- data/examples/action-cable/test/test_helper.rb +0 -10
- data/examples/action-cable/vendor/assets/javascripts/.keep +0 -0
- data/examples/action-cable/vendor/assets/stylesheets/.keep +0 -0
- data/examples/pusher-fake/.gitignore +0 -21
- data/examples/pusher-fake/Gemfile +0 -59
- data/examples/pusher-fake/Gemfile.lock +0 -262
- data/examples/pusher-fake/README.md +0 -24
- data/examples/pusher-fake/Rakefile +0 -6
- data/examples/pusher-fake/app/assets/config/manifest.js +0 -3
- data/examples/pusher-fake/app/assets/images/.keep +0 -0
- data/examples/pusher-fake/app/assets/javascripts/application.js +0 -21
- data/examples/pusher-fake/app/assets/stylesheets/application.css +0 -15
- data/examples/pusher-fake/app/controllers/application_controller.rb +0 -3
- data/examples/pusher-fake/app/controllers/test_controller.rb +0 -5
- data/examples/pusher-fake/app/models/models.rb +0 -2
- data/examples/pusher-fake/app/models/public/.keep +0 -0
- data/examples/pusher-fake/app/models/public/application_record.rb +0 -3
- data/examples/pusher-fake/app/models/public/word.rb +0 -2
- data/examples/pusher-fake/app/policies/application_policy.rb +0 -14
- data/examples/pusher-fake/app/views/components.rb +0 -16
- data/examples/pusher-fake/app/views/components/app.rb +0 -18
- data/examples/pusher-fake/app/views/layouts/application.html.erb +0 -14
- data/examples/pusher-fake/bin/bundle +0 -3
- data/examples/pusher-fake/bin/rails +0 -9
- data/examples/pusher-fake/bin/rake +0 -9
- data/examples/pusher-fake/bin/setup +0 -34
- data/examples/pusher-fake/bin/spring +0 -16
- data/examples/pusher-fake/bin/update +0 -29
- data/examples/pusher-fake/config.ru +0 -5
- data/examples/pusher-fake/config/application.rb +0 -20
- data/examples/pusher-fake/config/boot.rb +0 -3
- data/examples/pusher-fake/config/database.yml +0 -25
- data/examples/pusher-fake/config/environment.rb +0 -5
- data/examples/pusher-fake/config/environments/development.rb +0 -56
- data/examples/pusher-fake/config/environments/production.rb +0 -86
- data/examples/pusher-fake/config/environments/test.rb +0 -42
- data/examples/pusher-fake/config/initializers/application_controller_renderer.rb +0 -6
- data/examples/pusher-fake/config/initializers/assets.rb +0 -11
- data/examples/pusher-fake/config/initializers/backtrace_silencers.rb +0 -7
- data/examples/pusher-fake/config/initializers/cookies_serializer.rb +0 -5
- data/examples/pusher-fake/config/initializers/filter_parameter_logging.rb +0 -4
- data/examples/pusher-fake/config/initializers/hyper_mesh.rb +0 -21
- data/examples/pusher-fake/config/initializers/inflections.rb +0 -16
- data/examples/pusher-fake/config/initializers/mime_types.rb +0 -4
- data/examples/pusher-fake/config/initializers/new_framework_defaults.rb +0 -24
- data/examples/pusher-fake/config/initializers/session_store.rb +0 -3
- data/examples/pusher-fake/config/initializers/wrap_parameters.rb +0 -14
- data/examples/pusher-fake/config/locales/en.yml +0 -23
- data/examples/pusher-fake/config/puma.rb +0 -47
- data/examples/pusher-fake/config/routes.rb +0 -5
- data/examples/pusher-fake/config/secrets.yml +0 -22
- data/examples/pusher-fake/config/spring.rb +0 -6
- data/examples/pusher-fake/db/migrate/20161114213840_create_words.rb +0 -9
- data/examples/pusher-fake/db/schema.rb +0 -34
- data/examples/pusher-fake/db/seeds.rb +0 -7
- data/examples/pusher-fake/lib/assets/.keep +0 -0
- data/examples/pusher-fake/lib/tasks/.keep +0 -0
- data/examples/pusher-fake/public/404.html +0 -67
- data/examples/pusher-fake/public/422.html +0 -67
- data/examples/pusher-fake/public/500.html +0 -66
- data/examples/pusher-fake/public/apple-touch-icon-precomposed.png +0 -0
- data/examples/pusher-fake/public/apple-touch-icon.png +0 -0
- data/examples/pusher-fake/public/favicon.ico +0 -0
- data/examples/pusher-fake/public/robots.txt +0 -5
- data/examples/pusher-fake/test/controllers/.keep +0 -0
- data/examples/pusher-fake/test/fixtures/.keep +0 -0
- data/examples/pusher-fake/test/fixtures/files/.keep +0 -0
- data/examples/pusher-fake/test/fixtures/words.yml +0 -7
- data/examples/pusher-fake/test/helpers/.keep +0 -0
- data/examples/pusher-fake/test/integration/.keep +0 -0
- data/examples/pusher-fake/test/mailers/.keep +0 -0
- data/examples/pusher-fake/test/models/.keep +0 -0
- data/examples/pusher-fake/test/models/word_test.rb +0 -7
- data/examples/pusher-fake/test/test_helper.rb +0 -10
- data/examples/pusher-fake/vendor/assets/javascripts/.keep +0 -0
- data/examples/pusher-fake/vendor/assets/stylesheets/.keep +0 -0
- data/examples/pusher/.gitignore +0 -21
- data/examples/pusher/Gemfile +0 -58
- data/examples/pusher/Gemfile.lock +0 -236
- data/examples/pusher/README.md +0 -24
- data/examples/pusher/Rakefile +0 -6
- data/examples/pusher/app/assets/config/manifest.js +0 -3
- data/examples/pusher/app/assets/images/.keep +0 -0
- data/examples/pusher/app/assets/javascripts/application.js +0 -21
- data/examples/pusher/app/assets/stylesheets/application.css +0 -15
- data/examples/pusher/app/controllers/application_controller.rb +0 -3
- data/examples/pusher/app/controllers/test_controller.rb +0 -5
- data/examples/pusher/app/models/models.rb +0 -2
- data/examples/pusher/app/models/public/.keep +0 -0
- data/examples/pusher/app/models/public/application_record.rb +0 -3
- data/examples/pusher/app/models/public/word.rb +0 -2
- data/examples/pusher/app/policies/application_policy.rb +0 -14
- data/examples/pusher/app/views/components.rb +0 -16
- data/examples/pusher/app/views/components/app.rb +0 -18
- data/examples/pusher/app/views/layouts/application.html.erb +0 -14
- data/examples/pusher/bin/bundle +0 -3
- data/examples/pusher/bin/rails +0 -9
- data/examples/pusher/bin/rake +0 -9
- data/examples/pusher/bin/setup +0 -34
- data/examples/pusher/bin/spring +0 -16
- data/examples/pusher/bin/update +0 -29
- data/examples/pusher/config.ru +0 -5
- data/examples/pusher/config/application.rb +0 -20
- data/examples/pusher/config/boot.rb +0 -3
- data/examples/pusher/config/database.yml +0 -25
- data/examples/pusher/config/environment.rb +0 -5
- data/examples/pusher/config/environments/development.rb +0 -56
- data/examples/pusher/config/environments/production.rb +0 -86
- data/examples/pusher/config/environments/test.rb +0 -42
- data/examples/pusher/config/initializers/application_controller_renderer.rb +0 -6
- data/examples/pusher/config/initializers/assets.rb +0 -11
- data/examples/pusher/config/initializers/backtrace_silencers.rb +0 -7
- data/examples/pusher/config/initializers/cookies_serializer.rb +0 -5
- data/examples/pusher/config/initializers/filter_parameter_logging.rb +0 -4
- data/examples/pusher/config/initializers/hyper_mesh.rb +0 -10
- data/examples/pusher/config/initializers/inflections.rb +0 -16
- data/examples/pusher/config/initializers/mime_types.rb +0 -4
- data/examples/pusher/config/initializers/new_framework_defaults.rb +0 -24
- data/examples/pusher/config/initializers/session_store.rb +0 -3
- data/examples/pusher/config/initializers/wrap_parameters.rb +0 -14
- data/examples/pusher/config/locales/en.yml +0 -23
- data/examples/pusher/config/puma.rb +0 -47
- data/examples/pusher/config/routes.rb +0 -5
- data/examples/pusher/config/secrets.yml +0 -22
- data/examples/pusher/config/spring.rb +0 -6
- data/examples/pusher/db/migrate/20161114213840_create_words.rb +0 -9
- data/examples/pusher/db/schema.rb +0 -34
- data/examples/pusher/db/seeds.rb +0 -7
- data/examples/pusher/lib/assets/.keep +0 -0
- data/examples/pusher/lib/tasks/.keep +0 -0
- data/examples/pusher/public/404.html +0 -67
- data/examples/pusher/public/422.html +0 -67
- data/examples/pusher/public/500.html +0 -66
- data/examples/pusher/public/apple-touch-icon-precomposed.png +0 -0
- data/examples/pusher/public/apple-touch-icon.png +0 -0
- data/examples/pusher/public/favicon.ico +0 -0
- data/examples/pusher/public/robots.txt +0 -5
- data/examples/pusher/test/controllers/.keep +0 -0
- data/examples/pusher/test/fixtures/.keep +0 -0
- data/examples/pusher/test/fixtures/files/.keep +0 -0
- data/examples/pusher/test/fixtures/words.yml +0 -7
- data/examples/pusher/test/helpers/.keep +0 -0
- data/examples/pusher/test/integration/.keep +0 -0
- data/examples/pusher/test/mailers/.keep +0 -0
- data/examples/pusher/test/models/.keep +0 -0
- data/examples/pusher/test/models/word_test.rb +0 -7
- data/examples/pusher/test/test_helper.rb +0 -10
- data/examples/pusher/vendor/assets/javascripts/.keep +0 -0
- data/examples/pusher/vendor/assets/stylesheets/.keep +0 -0
- data/examples/simple-poller/.gitignore +0 -21
- data/examples/simple-poller/Gemfile +0 -57
- data/examples/simple-poller/Gemfile.lock +0 -229
- data/examples/simple-poller/README.md +0 -24
- data/examples/simple-poller/Rakefile +0 -6
- data/examples/simple-poller/app/assets/config/manifest.js +0 -3
- data/examples/simple-poller/app/assets/images/.keep +0 -0
- data/examples/simple-poller/app/assets/javascripts/application.js +0 -21
- data/examples/simple-poller/app/assets/stylesheets/application.css +0 -15
- data/examples/simple-poller/app/controllers/application_controller.rb +0 -3
- data/examples/simple-poller/app/controllers/test_controller.rb +0 -5
- data/examples/simple-poller/app/models/models.rb +0 -2
- data/examples/simple-poller/app/models/public/.keep +0 -0
- data/examples/simple-poller/app/models/public/application_record.rb +0 -3
- data/examples/simple-poller/app/models/public/word.rb +0 -2
- data/examples/simple-poller/app/policies/application_policy.rb +0 -14
- data/examples/simple-poller/app/views/components.rb +0 -16
- data/examples/simple-poller/app/views/components/app.rb +0 -18
- data/examples/simple-poller/app/views/layouts/application.html.erb +0 -14
- data/examples/simple-poller/bin/bundle +0 -3
- data/examples/simple-poller/bin/rails +0 -9
- data/examples/simple-poller/bin/rake +0 -9
- data/examples/simple-poller/bin/setup +0 -34
- data/examples/simple-poller/bin/spring +0 -16
- data/examples/simple-poller/bin/update +0 -29
- data/examples/simple-poller/config.ru +0 -5
- data/examples/simple-poller/config/application.rb +0 -20
- data/examples/simple-poller/config/boot.rb +0 -3
- data/examples/simple-poller/config/database.yml +0 -25
- data/examples/simple-poller/config/environment.rb +0 -5
- data/examples/simple-poller/config/environments/development.rb +0 -56
- data/examples/simple-poller/config/environments/production.rb +0 -86
- data/examples/simple-poller/config/environments/test.rb +0 -42
- data/examples/simple-poller/config/initializers/application_controller_renderer.rb +0 -6
- data/examples/simple-poller/config/initializers/assets.rb +0 -11
- data/examples/simple-poller/config/initializers/backtrace_silencers.rb +0 -7
- data/examples/simple-poller/config/initializers/cookies_serializer.rb +0 -5
- data/examples/simple-poller/config/initializers/filter_parameter_logging.rb +0 -4
- data/examples/simple-poller/config/initializers/hyper_mesh.rb +0 -9
- data/examples/simple-poller/config/initializers/inflections.rb +0 -16
- data/examples/simple-poller/config/initializers/mime_types.rb +0 -4
- data/examples/simple-poller/config/initializers/new_framework_defaults.rb +0 -24
- data/examples/simple-poller/config/initializers/session_store.rb +0 -3
- data/examples/simple-poller/config/initializers/wrap_parameters.rb +0 -14
- data/examples/simple-poller/config/locales/en.yml +0 -23
- data/examples/simple-poller/config/puma.rb +0 -47
- data/examples/simple-poller/config/routes.rb +0 -5
- data/examples/simple-poller/config/secrets.yml +0 -22
- data/examples/simple-poller/config/spring.rb +0 -6
- data/examples/simple-poller/db/migrate/20161114213840_create_words.rb +0 -9
- data/examples/simple-poller/db/schema.rb +0 -34
- data/examples/simple-poller/db/seeds.rb +0 -7
- data/examples/simple-poller/lib/assets/.keep +0 -0
- data/examples/simple-poller/lib/tasks/.keep +0 -0
- data/examples/simple-poller/public/404.html +0 -67
- data/examples/simple-poller/public/422.html +0 -67
- data/examples/simple-poller/public/500.html +0 -66
- data/examples/simple-poller/public/apple-touch-icon-precomposed.png +0 -0
- data/examples/simple-poller/public/apple-touch-icon.png +0 -0
- data/examples/simple-poller/public/favicon.ico +0 -0
- data/examples/simple-poller/public/robots.txt +0 -5
- data/examples/simple-poller/test/controllers/.keep +0 -0
- data/examples/simple-poller/test/fixtures/.keep +0 -0
- data/examples/simple-poller/test/fixtures/files/.keep +0 -0
- data/examples/simple-poller/test/fixtures/words.yml +0 -7
- data/examples/simple-poller/test/helpers/.keep +0 -0
- data/examples/simple-poller/test/integration/.keep +0 -0
- data/examples/simple-poller/test/mailers/.keep +0 -0
- data/examples/simple-poller/test/models/.keep +0 -0
- data/examples/simple-poller/test/models/word_test.rb +0 -7
- data/examples/simple-poller/test/test_helper.rb +0 -10
- data/examples/simple-poller/vendor/assets/javascripts/.keep +0 -0
- data/examples/simple-poller/vendor/assets/stylesheets/.keep +0 -0
- data/examples/word-game/.gitignore +0 -21
- data/examples/word-game/Gemfile +0 -57
- data/examples/word-game/Gemfile.lock +0 -241
- data/examples/word-game/README.md +0 -24
- data/examples/word-game/Rakefile +0 -6
- data/examples/word-game/app/assets/config/manifest.js +0 -3
- data/examples/word-game/app/assets/images/.keep +0 -0
- data/examples/word-game/app/assets/javascripts/application.js +0 -20
- data/examples/word-game/app/assets/javascripts/cable.js +0 -13
- data/examples/word-game/app/assets/javascripts/channels/.keep +0 -0
- data/examples/word-game/app/assets/stylesheets/application.css +0 -15
- data/examples/word-game/app/channels/application_cable/channel.rb +0 -4
- data/examples/word-game/app/channels/application_cable/connection.rb +0 -4
- data/examples/word-game/app/controllers/application_controller.rb +0 -3
- data/examples/word-game/app/controllers/concerns/.keep +0 -0
- data/examples/word-game/app/helpers/application_helper.rb +0 -2
- data/examples/word-game/app/jobs/application_job.rb +0 -2
- data/examples/word-game/app/mailers/application_mailer.rb +0 -4
- data/examples/word-game/app/models/application_record.rb +0 -3
- data/examples/word-game/app/models/concerns/.keep +0 -0
- data/examples/word-game/app/models/models.rb +0 -2
- data/examples/word-game/app/models/public/.keep +0 -0
- data/examples/word-game/app/policies/application_policy.rb +0 -14
- data/examples/word-game/app/views/components.rb +0 -16
- data/examples/word-game/app/views/components/.keep +0 -0
- data/examples/word-game/app/views/layouts/application.html.erb +0 -14
- data/examples/word-game/app/views/layouts/mailer.html.erb +0 -13
- data/examples/word-game/app/views/layouts/mailer.text.erb +0 -1
- data/examples/word-game/bin/bundle +0 -3
- data/examples/word-game/bin/rails +0 -9
- data/examples/word-game/bin/rake +0 -9
- data/examples/word-game/bin/setup +0 -34
- data/examples/word-game/bin/spring +0 -16
- data/examples/word-game/bin/update +0 -29
- data/examples/word-game/config.ru +0 -5
- data/examples/word-game/config/application.rb +0 -20
- data/examples/word-game/config/boot.rb +0 -3
- data/examples/word-game/config/cable.yml +0 -9
- data/examples/word-game/config/database.yml +0 -25
- data/examples/word-game/config/environment.rb +0 -5
- data/examples/word-game/config/environments/development.rb +0 -56
- data/examples/word-game/config/environments/production.rb +0 -86
- data/examples/word-game/config/environments/test.rb +0 -42
- data/examples/word-game/config/initializers/application_controller_renderer.rb +0 -6
- data/examples/word-game/config/initializers/assets.rb +0 -11
- data/examples/word-game/config/initializers/backtrace_silencers.rb +0 -7
- data/examples/word-game/config/initializers/cookies_serializer.rb +0 -5
- data/examples/word-game/config/initializers/filter_parameter_logging.rb +0 -4
- data/examples/word-game/config/initializers/hyper_mesh.rb +0 -4
- data/examples/word-game/config/initializers/inflections.rb +0 -16
- data/examples/word-game/config/initializers/mime_types.rb +0 -4
- data/examples/word-game/config/initializers/new_framework_defaults.rb +0 -24
- data/examples/word-game/config/initializers/session_store.rb +0 -3
- data/examples/word-game/config/initializers/wrap_parameters.rb +0 -14
- data/examples/word-game/config/locales/en.yml +0 -23
- data/examples/word-game/config/puma.rb +0 -47
- data/examples/word-game/config/routes.rb +0 -4
- data/examples/word-game/config/secrets.yml +0 -22
- data/examples/word-game/config/spring.rb +0 -6
- data/examples/word-game/db/seeds.rb +0 -7
- data/examples/word-game/lib/assets/.keep +0 -0
- data/examples/word-game/lib/tasks/.keep +0 -0
- data/examples/word-game/public/404.html +0 -67
- data/examples/word-game/public/422.html +0 -67
- data/examples/word-game/public/500.html +0 -66
- data/examples/word-game/public/apple-touch-icon-precomposed.png +0 -0
- data/examples/word-game/public/apple-touch-icon.png +0 -0
- data/examples/word-game/public/favicon.ico +0 -0
- data/examples/word-game/public/robots.txt +0 -5
- data/examples/word-game/test/controllers/.keep +0 -0
- data/examples/word-game/test/fixtures/.keep +0 -0
- data/examples/word-game/test/fixtures/files/.keep +0 -0
- data/examples/word-game/test/helpers/.keep +0 -0
- data/examples/word-game/test/integration/.keep +0 -0
- data/examples/word-game/test/mailers/.keep +0 -0
- data/examples/word-game/test/models/.keep +0 -0
- data/examples/word-game/test/test_helper.rb +0 -10
- data/examples/word-game/vendor/assets/javascripts/.keep +0 -0
- data/examples/word-game/vendor/assets/stylesheets/.keep +0 -0
- data/examples/words/.gitignore +0 -21
- data/examples/words/Gemfile +0 -59
- data/examples/words/Gemfile.lock +0 -248
- data/examples/words/README.md +0 -24
- data/examples/words/Rakefile +0 -6
- data/examples/words/app/assets/config/manifest.js +0 -3
- data/examples/words/app/assets/javascripts/application.js +0 -18
- data/examples/words/app/assets/stylesheets/application.css +0 -15
- data/examples/words/app/controllers/application_controller.rb +0 -3
- data/examples/words/app/controllers/test_controller.rb +0 -6
- data/examples/words/app/models/models.rb +0 -2
- data/examples/words/app/models/public/application_record.rb +0 -3
- data/examples/words/app/models/public/word.rb +0 -10
- data/examples/words/app/policies/application_policy.rb +0 -6
- data/examples/words/app/views/components.rb +0 -18
- data/examples/words/app/views/components/app.rb +0 -31
- data/examples/words/app/views/layouts/application.html.erb +0 -14
- data/examples/words/app/views/layouts/mailer.html.erb +0 -13
- data/examples/words/app/views/layouts/mailer.text.erb +0 -1
- data/examples/words/bin/bundle +0 -3
- data/examples/words/bin/rails +0 -9
- data/examples/words/bin/rake +0 -9
- data/examples/words/bin/setup +0 -34
- data/examples/words/bin/spring +0 -15
- data/examples/words/bin/update +0 -29
- data/examples/words/config.ru +0 -5
- data/examples/words/config/application.rb +0 -30
- data/examples/words/config/boot.rb +0 -3
- data/examples/words/config/cable.yml +0 -9
- data/examples/words/config/database.yml +0 -25
- data/examples/words/config/environment.rb +0 -5
- data/examples/words/config/environments/development.rb +0 -45
- data/examples/words/config/environments/production.rb +0 -86
- data/examples/words/config/environments/test.rb +0 -42
- data/examples/words/config/initializers/application_controller_renderer.rb +0 -6
- data/examples/words/config/initializers/assets.rb +0 -11
- data/examples/words/config/initializers/backtrace_silencers.rb +0 -7
- data/examples/words/config/initializers/cookies_serializer.rb +0 -5
- data/examples/words/config/initializers/filter_parameter_logging.rb +0 -4
- data/examples/words/config/initializers/hyper_mesh.rb +0 -14
- data/examples/words/config/initializers/inflections.rb +0 -16
- data/examples/words/config/initializers/mime_types.rb +0 -4
- data/examples/words/config/initializers/new_framework_defaults.rb +0 -24
- data/examples/words/config/initializers/session_store.rb +0 -3
- data/examples/words/config/initializers/wrap_parameters.rb +0 -14
- data/examples/words/config/locales/en.yml +0 -23
- data/examples/words/config/puma.rb +0 -47
- data/examples/words/config/routes.rb +0 -5
- data/examples/words/config/secrets.yml +0 -22
- data/examples/words/config/spring.rb +0 -6
- data/examples/words/db/migrate/20160921223808_create_words.rb +0 -9
- data/examples/words/db/schema.rb +0 -28
- data/examples/words/public/404.html +0 -67
- data/examples/words/public/422.html +0 -67
- data/examples/words/public/500.html +0 -66
- data/examples/words/public/apple-touch-icon-precomposed.png +0 -0
- data/examples/words/public/apple-touch-icon.png +0 -0
- data/examples/words/public/favicon.ico +0 -0
- data/examples/words/public/robots.txt +0 -5
- data/examples/words/vendor/assets/javascripts/.keep +0 -0
- data/examples/words/vendor/assets/stylesheets/.keep +0 -0
- data/reactive_record_test_app/Gemfile +0 -20
- data/reactive_record_test_app/Gemfile.lock +0 -269
- data/reactive_record_test_app/Rakefile +0 -7
- data/reactive_record_test_app/app/assets/javascripts/application.rb +0 -3
- data/reactive_record_test_app/app/assets/javascripts/bigdecimal.rb +0 -1
- data/reactive_record_test_app/app/assets/javascripts/reactive_record_config.js +0 -2
- data/reactive_record_test_app/app/assets/stylesheets/application.css +0 -13
- data/reactive_record_test_app/app/controllers/application_controller.rb +0 -8
- data/reactive_record_test_app/app/controllers/home_controller.rb +0 -7
- data/reactive_record_test_app/app/helpers/application_helper.rb +0 -2
- data/reactive_record_test_app/app/models/models.rb.erb +0 -6
- data/reactive_record_test_app/app/models/public/address.rb +0 -13
- data/reactive_record_test_app/app/models/public/comment.rb +0 -19
- data/reactive_record_test_app/app/models/public/todo_item.rb +0 -36
- data/reactive_record_test_app/app/models/public/user.rb +0 -78
- data/reactive_record_test_app/config.ru +0 -33
- data/reactive_record_test_app/config/application.rb +0 -75
- data/reactive_record_test_app/config/boot.rb +0 -10
- data/reactive_record_test_app/config/database.yml +0 -25
- data/reactive_record_test_app/config/environment.rb +0 -5
- data/reactive_record_test_app/config/environments/development.rb +0 -43
- data/reactive_record_test_app/config/initializers/backtrace_silencers.rb +0 -7
- data/reactive_record_test_app/config/initializers/hyper_mesh_legacy_behavior.rb +0 -5
- data/reactive_record_test_app/config/initializers/inflections.rb +0 -15
- data/reactive_record_test_app/config/initializers/mime_types.rb +0 -5
- data/reactive_record_test_app/config/initializers/secret_token.rb +0 -7
- data/reactive_record_test_app/config/initializers/session_store.rb +0 -8
- data/reactive_record_test_app/config/initializers/wrap_parameters.rb +0 -14
- data/reactive_record_test_app/config/locales/en.yml +0 -5
- data/reactive_record_test_app/config/routes.rb +0 -6
- data/reactive_record_test_app/db/migrate/20150617002932_create_todo_items.rb +0 -11
- data/reactive_record_test_app/db/migrate/20150617134028_create_users.rb +0 -14
- data/reactive_record_test_app/db/migrate/20150729195556_add_address_to_user.rb +0 -20
- data/reactive_record_test_app/db/migrate/20150826142045_create_comments.rb +0 -10
- data/reactive_record_test_app/db/migrate/20150828172008_add_single_comment_to_todo_item.rb +0 -5
- data/reactive_record_test_app/db/migrate/20150908184118_add_address_id_to_user.rb +0 -5
- data/reactive_record_test_app/db/migrate/20150917220236_add_second_address_to_user.rb +0 -10
- data/reactive_record_test_app/db/migrate/20151009000111_add_test_data_attributes_to_user.rb +0 -6
- data/reactive_record_test_app/db/migrate/20160129182544_add_test_enum_to_user.rb +0 -5
- data/reactive_record_test_app/db/schema.rb +0 -63
- data/reactive_record_test_app/db/seeds.rb +0 -66
- data/reactive_record_test_app/public/404.html +0 -26
- data/reactive_record_test_app/public/422.html +0 -26
- data/reactive_record_test_app/public/500.html +0 -25
- data/reactive_record_test_app/public/favicon.ico +0 -0
- data/reactive_record_test_app/script/rails +0 -6
- data/reactive_record_test_app/spec-opal/active-record/aggregations_spec.rb +0 -41
- data/reactive_record_test_app/spec-opal/active-record/associations_spec.rb +0 -75
- data/reactive_record_test_app/spec-opal/active-record/base_spec.rb +0 -126
- data/reactive_record_test_app/spec-opal/active-record/dummy_value_spec.rb +0 -27
- data/reactive_record_test_app/spec-opal/active-record/edge_cases_spec.rb +0 -116
- data/reactive_record_test_app/spec-opal/active-record/enum_spec.rb +0 -43
- data/reactive_record_test_app/spec-opal/active-record/instance_methods_spec.rb +0 -53
- data/reactive_record_test_app/spec-opal/active-record/non_ar_aggregations_spec.rb +0 -74
- data/reactive_record_test_app/spec-opal/active-record/reactive_record_load_spec.rb +0 -23
- data/reactive_record_test_app/spec-opal/active-record/rendering_spec.rb +0 -230
- data/reactive_record_test_app/spec-opal/active-record/save_spec.rb +0 -124
- data/reactive_record_test_app/spec-opal/active-record/scope_spec.rb +0 -85
- data/reactive_record_test_app/spec-opal/active-record/update_aggregations_spec.rb +0 -76
- data/reactive_record_test_app/spec-opal/active-record/update_attributes_spec.rb +0 -186
- data/reactive_record_test_app/spec-opal/active-record/virtual_methods_spec.rb +0 -71
- data/reactive_record_test_app/spec-opal/index.html.erb +0 -11
- data/reactive_record_test_app/spec-opal/spec_helper.js.rb +0 -268
- data/reactive_record_test_app/spec-opal/test_spec.rb +0 -7
- data/reactive_record_test_app/spec-opal/vendor/es5-shim.min.js +0 -6
- data/reactive_record_test_app/spec_dont_run/README.md +0 -33
- data/reactive_record_test_app/spec_dont_run/active_record_broken/permissions_spec.rb +0 -170
- data/reactive_record_test_app/spec_dont_run/active_record_broken/prerendering_spec.rb +0 -50
- data/reactive_record_test_app/spec_dont_run/moved_to_main_spec_dir/zzzmany_to_many_spec_moved_to_main_suite.rb +0 -30
- data/reactive_record_test_app/spec_dont_run/moved_to_main_spec_dir/zzzrevert_record_spec_moved.rb +0 -78
- data/reactive_record_test_app/spec_dont_run/moved_to_main_spec_dir/zzzupdate_associations_spec_moved.rb +0 -142
- data/reactive_record_test_app/spec_dont_run/moved_to_main_spec_dir/zzzupdate_scopes_movedspec.rb +0 -48
- data/spec/batch1/aaa-unit_tests/connection_movedspec.rb +0 -144
- data/spec/batch1/aaa-unit_tests/dummy_value_spec.rb +0 -26
- data/spec/batch1/column_types/column_type_spec.rb +0 -318
- data/spec/batch1/crud_access_regulation/broadcast_controls_access_spec.rb +0 -99
- data/spec/batch1/crud_access_regulation/model_policies_spec.rb +0 -133
- data/spec/batch1/misc/access_like_hash_spec.rb +0 -43
- data/spec/batch1/misc/while_loading_spec.rb +0 -196
- data/spec/batch1/policies/regulate_all_broadcasts_spec.rb +0 -315
- data/spec/batch1/policies/regulate_broadcast_spec.rb +0 -370
- data/spec/batch2/authorization_spec.rb +0 -112
- data/spec/batch2/default_scope_spec.rb +0 -121
- data/spec/batch2/has_many_through_spec.rb +0 -169
- data/spec/batch2/relationships_spec.rb +0 -263
- data/spec/batch3/auto_load_itself_spec.rb +0 -24
- data/spec/batch3/edge_cases_spec.rb +0 -31
- data/spec/batch3/finder_method_spec.rb +0 -67
- data/spec/batch3/many_to_many_spec.rb +0 -50
- data/spec/batch3/pry_rescue_xspec.rb +0 -48
- data/spec/batch3/readme.txt +0 -0
- data/spec/batch3/revert_spec.rb +0 -113
- data/spec/batch3/save_while_loading_spec.rb +0 -44
- data/spec/batch3/update_associations_spec.rb +0 -189
- data/spec/batch3/update_scopes_spec.rb +0 -54
- data/spec/batch4/saving_during_commit_spec.rb +0 -64
- data/spec/batch4/scope_spec.rb +0 -581
- data/spec/batch4/scoped_todos_spec.rb +0 -167
- data/spec/batch4/synchromesh_spec.rb +0 -80
- data/spec/bin/firebug-2.0.13-fx.xpi +0 -0
- data/spec/component_helpers_xspec.rb +0 -49
- data/spec/examples/dictionary.rb +0 -239
- data/spec/examples/dictionary_with_client_scopes.rb +0 -196
- data/spec/examples/random_examples.rb +0 -133
- data/spec/factories/child_model.rb +0 -5
- data/spec/factories/comment.rb +0 -5
- data/spec/factories/test_models.rb +0 -5
- data/spec/factories/todo.rb +0 -5
- data/spec/factories/user.rb +0 -5
- data/spec/play_ground.rb +0 -64
- data/spec/reactive_record_factory.rb +0 -62
- data/spec/spec_helper.rb +0 -372
- data/spec/support/component_helpers.rb +0 -351
- data/spec/test_app/Gemfile +0 -66
- data/spec/test_app/Gemfile.lock +0 -303
- data/spec/test_app/Rakefile +0 -6
- data/spec/test_app/app/assets/javascripts/application.js +0 -6
- data/spec/test_app/app/assets/stylesheets/application.css +0 -15
- data/spec/test_app/app/controllers/application_controller.rb +0 -13
- data/spec/test_app/app/controllers/test_controller.rb +0 -5
- data/spec/test_app/app/models/_react_public_models.rb +0 -2
- data/spec/test_app/app/models/public/address.rb +0 -13
- data/spec/test_app/app/models/public/child_model.rb +0 -3
- data/spec/test_app/app/models/public/comment.rb +0 -25
- data/spec/test_app/app/models/public/test_model.rb +0 -5
- data/spec/test_app/app/models/public/todo.rb +0 -6
- data/spec/test_app/app/models/public/todo_item.rb +0 -36
- data/spec/test_app/app/models/public/user.rb +0 -88
- data/spec/test_app/app/policies/auto_loader_test_classa_policy.rb +0 -3
- data/spec/test_app/app/policies/auto_loader_test_classb_policy.rb +0 -3
- data/spec/test_app/app/policies/auto_loader_test_classc_policy.rb +0 -3
- data/spec/test_app/app/policies/auto_loader_test_classd_policy.rb +0 -3
- data/spec/test_app/app/views/components.rb +0 -13
- data/spec/test_app/app/views/components/show.rb +0 -5
- data/spec/test_app/app/views/layouts/application.html.erb +0 -14
- data/spec/test_app/bin/bundle +0 -3
- data/spec/test_app/bin/rails +0 -4
- data/spec/test_app/bin/rake +0 -4
- data/spec/test_app/bin/setup +0 -29
- data/spec/test_app/config.ru +0 -4
- data/spec/test_app/config/application.rb +0 -44
- data/spec/test_app/config/boot.rb +0 -6
- data/spec/test_app/config/cable.yml +0 -10
- data/spec/test_app/config/database.yml +0 -47
- data/spec/test_app/config/environment.rb +0 -5
- data/spec/test_app/config/environments/development.rb +0 -41
- data/spec/test_app/config/environments/production.rb +0 -79
- data/spec/test_app/config/environments/test.rb +0 -42
- data/spec/test_app/config/initializers/assets.rb +0 -11
- data/spec/test_app/config/initializers/backtrace_silencers.rb +0 -7
- data/spec/test_app/config/initializers/cookies_serializer.rb +0 -3
- data/spec/test_app/config/initializers/filter_parameter_logging.rb +0 -4
- data/spec/test_app/config/initializers/inflections.rb +0 -16
- data/spec/test_app/config/initializers/mime_types.rb +0 -4
- data/spec/test_app/config/initializers/session_store.rb +0 -3
- data/spec/test_app/config/initializers/synchromesh.rb +0 -11
- data/spec/test_app/config/initializers/wrap_parameters.rb +0 -14
- data/spec/test_app/config/locales/en.yml +0 -23
- data/spec/test_app/config/routes.rb +0 -61
- data/spec/test_app/config/secrets.yml +0 -22
- data/spec/test_app/db/development.sqlite3 +0 -0
- data/spec/test_app/db/migrate/20160731182106_create_test_models.rb +0 -75
- data/spec/test_app/db/schema.rb +0 -88
- data/spec/test_app/db/seeds.rb +0 -7
- data/spec/test_app/lib/assets/.keep +0 -0
- data/spec/test_app/public/404.html +0 -67
- data/spec/test_app/public/422.html +0 -67
- data/spec/test_app/public/500.html +0 -66
- data/spec/test_app/public/favicon.ico +0 -0
- data/spec/test_components.rb +0 -18
- data/spec/vendor/es5-shim.min.js +0 -6
data/lib/active_record_base.rb
CHANGED
@@ -44,7 +44,7 @@ module ActiveRecord
|
|
44
44
|
end
|
45
45
|
|
46
46
|
def server_method(name, opts = {}, &block)
|
47
|
-
define_method
|
47
|
+
define_method(name, &block)
|
48
48
|
end
|
49
49
|
|
50
50
|
def finder_method(name, &block)
|
@@ -63,8 +63,8 @@ module ActiveRecord
|
|
63
63
|
def method_missing(name, *args, &block)
|
64
64
|
#return get_by_index(*args).first if name == "[]"
|
65
65
|
return all.send(name, *args, &block) if [].respond_to?(name)
|
66
|
-
if name
|
67
|
-
return send(name.
|
66
|
+
if name.end_with?('!')
|
67
|
+
return send(name.chop, *args, &block).send(:reload_from_db) rescue nil
|
68
68
|
end
|
69
69
|
pre_synchromesh_method_missing(name, *args, &block)
|
70
70
|
end
|
data/lib/hypermesh/version.rb
CHANGED
data/lib/opal/parse_patch.rb
CHANGED
@@ -32,7 +32,7 @@ module ActiveRecord
|
|
32
32
|
@klass_name = options[:class_name] || name.camelize
|
33
33
|
@attribute = name
|
34
34
|
if options[:mapping].respond_to? :collect
|
35
|
-
@mapped_attributes = options[:mapping].collect
|
35
|
+
@mapped_attributes = options[:mapping].collect(&:last)
|
36
36
|
else
|
37
37
|
ReactiveRecord::Base.log("improper aggregate definition #{@owner_class}, :#{name}, class_name: #{@klass_name} - missing mapping", :error)
|
38
38
|
@mapped_attributes = []
|
@@ -33,11 +33,7 @@ module ActiveRecord
|
|
33
33
|
@owner_class = owner_class
|
34
34
|
@macro = macro
|
35
35
|
@options = options
|
36
|
-
@klass_name = options[:class_name] || (collection? && name.camelize.
|
37
|
-
if @klass_name < ActiveRecord::Base
|
38
|
-
@klass = @klass_name
|
39
|
-
@klass_name = @klass_name.name
|
40
|
-
end rescue nil
|
36
|
+
@klass_name = options[:class_name] || (collection? && name.camelize.sub(/s$/, '')) || name.camelize
|
41
37
|
@association_foreign_key = options[:foreign_key] || (macro == :belongs_to && "#{name}_id") || "#{@owner_class.name.underscore}_id"
|
42
38
|
@source = options[:source] || @klass_name.underscore if options[:through]
|
43
39
|
@attribute = name
|
@@ -53,6 +53,10 @@ module ActiveRecord
|
|
53
53
|
# when we implement schema validation we should also implement value checking
|
54
54
|
end
|
55
55
|
|
56
|
+
def serialize(attr, *args)
|
57
|
+
ReactiveRecord::Base.serialized?[self][attr] = true
|
58
|
+
end
|
59
|
+
|
56
60
|
# ignore any of these methods if they get called on the client. This list should be trimmed down to include only
|
57
61
|
# methods to be called as "macros" such as :after_create, etc...
|
58
62
|
SERVER_METHODS = [
|
@@ -139,8 +143,8 @@ module ActiveRecord
|
|
139
143
|
]
|
140
144
|
|
141
145
|
def method_missing(name, *args, &block)
|
142
|
-
if args.count == 1 && name
|
143
|
-
find_by(name.
|
146
|
+
if args.count == 1 && name.start_with?("find_by_") && !block
|
147
|
+
find_by(name.sub(/^find_by_/, "") => args[0])
|
144
148
|
elsif !SERVER_METHODS.include?(name)
|
145
149
|
raise "#{self.name}.#{name}(#{args}) (called class method missing)"
|
146
150
|
end
|
@@ -168,27 +172,6 @@ module ActiveRecord
|
|
168
172
|
ReactiveRecord::Base.class_scopes(self)[:all] = collection
|
169
173
|
end
|
170
174
|
|
171
|
-
# def server_methods(*methods)
|
172
|
-
# methods.each do |method|
|
173
|
-
# define_method(method) do |*args|
|
174
|
-
# if args.count == 0
|
175
|
-
# @backing_record.reactive_get!(method, :initialize)
|
176
|
-
# else
|
177
|
-
# @backing_record.reactive_get!([[method]+args], :initialize)
|
178
|
-
# end
|
179
|
-
# end
|
180
|
-
# define_method("#{method}!") do |*args|
|
181
|
-
# if args.count == 0
|
182
|
-
# @backing_record.reactive_get!(method, :force)
|
183
|
-
# else
|
184
|
-
# @backing_record.reactive_get!([[method]+args], :force)
|
185
|
-
# end
|
186
|
-
# end
|
187
|
-
# end
|
188
|
-
# end
|
189
|
-
#
|
190
|
-
# alias_method :server_method, :server_methods
|
191
|
-
|
192
175
|
[:belongs_to, :has_many, :has_one].each do |macro|
|
193
176
|
define_method(macro) do |*args| # is this a bug in opal? saying name, scope=nil, opts={} does not work!
|
194
177
|
name = args.first
|
@@ -86,19 +86,39 @@ module ActiveRecord
|
|
86
86
|
end
|
87
87
|
|
88
88
|
def method_missing(name, *args, &block)
|
89
|
-
|
90
|
-
|
91
|
-
|
89
|
+
original_name = name
|
90
|
+
|
91
|
+
if name.end_with?('!')
|
92
|
+
name = name.chop # remove '!'
|
92
93
|
force_update = true
|
93
94
|
end
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
95
|
+
|
96
|
+
chopped_name = name.end_with?('=') ? name.chop : name
|
97
|
+
is_server_method = self.class.server_methods.has_key?(chopped_name)
|
98
|
+
chopped_name = chopped_name.end_with?('?') ? chopped_name.chop : name
|
99
|
+
is_attribute = attributes.has_key?(chopped_name)
|
100
|
+
|
101
|
+
unless is_server_method || is_attribute
|
102
|
+
if ReactiveRecord::Base.public_columns_hash.has_key?(self.class.name) && ReactiveRecord::Base.public_columns_hash[self.class.name].has_key?(chopped_name)
|
103
|
+
is_attribute = true
|
104
|
+
end
|
105
|
+
method_missing_warning("#{original_name}(#{args})") unless is_attribute
|
106
|
+
end
|
107
|
+
|
108
|
+
if name.end_with?('_changed?')
|
109
|
+
@backing_record.changed?(name[0...-9]) # remove '_changed?'
|
110
|
+
elsif args.count == 1 && name.end_with?('=') && !block
|
111
|
+
attribute_name = name.chop # remove '='
|
112
|
+
# for rails auto generated methods for booleans, remove '?' to get the attribute
|
113
|
+
attribute_name = attribute_name.chop if !is_server_method && is_attribute && attribute_name.end_with?('?')
|
98
114
|
@backing_record.reactive_set!(attribute_name, backing_record.convert(attribute_name, args[0]))
|
99
115
|
elsif args.count.zero? && !block
|
116
|
+
# for rails auto generated methods for booleans, remove '?' to get the attribute
|
117
|
+
name = name.chop if !is_server_method && is_attribute && name.end_with?('?')
|
100
118
|
@backing_record.reactive_get!(name, force_update)
|
101
|
-
elsif !block
|
119
|
+
elsif !block
|
120
|
+
# for rails auto generated methods for booleans, remove '?' to get the attribute
|
121
|
+
name = name.chop if !is_server_method && is_attribute && name.end_with?('?')
|
102
122
|
@backing_record.reactive_get!([[name]+args], force_update)
|
103
123
|
else
|
104
124
|
super
|
@@ -116,7 +136,7 @@ module ActiveRecord
|
|
116
136
|
first_time = true
|
117
137
|
ReactiveRecord.load do
|
118
138
|
results = attributes.collect { |attr| @backing_record.reactive_get!(attr, first_time) }
|
119
|
-
results = yield
|
139
|
+
results = yield(*results) if block
|
120
140
|
first_time = false
|
121
141
|
block.nil? && results.count == 1 ? results.first : results
|
122
142
|
end
|
@@ -131,7 +151,7 @@ module ActiveRecord
|
|
131
151
|
end
|
132
152
|
|
133
153
|
def destroy(&block)
|
134
|
-
@backing_record.destroy
|
154
|
+
@backing_record.destroy(&block)
|
135
155
|
end
|
136
156
|
|
137
157
|
def destroyed?
|
@@ -1,25 +1,44 @@
|
|
1
1
|
module Hyperloop
|
2
|
-
define_setting :public_model_directories, ['app
|
2
|
+
define_setting :public_model_directories, [File.join('app','hyperloop','models'), File.join('app','models','public')]
|
3
3
|
end
|
4
4
|
|
5
5
|
module ActiveRecord
|
6
6
|
# adds method to get the HyperMesh public column types
|
7
|
-
#
|
8
|
-
# look through the public folder, and just get those models.
|
9
|
-
# this works because the public folder is currently required to be eaer loaded.
|
7
|
+
# this works because the public folder is currently required to be eager loaded.
|
10
8
|
class Base
|
11
9
|
def self.public_columns_hash
|
12
|
-
return @public_columns_hash if @public_columns_hash
|
10
|
+
return @public_columns_hash if @public_columns_hash && Rails.env.production?
|
11
|
+
files = []
|
13
12
|
Hyperloop.public_model_directories.each do |dir|
|
14
|
-
|
15
|
-
|
13
|
+
dir_length = Rails.root.join(dir).to_s.length + 1
|
14
|
+
Dir.glob(Rails.root.join(dir, '**', '*.rb')).each do |file|
|
15
|
+
require_dependency(file) # still the file is loaded to make sure for development and test env
|
16
|
+
files << file[dir_length..-4]
|
16
17
|
end
|
17
18
|
end
|
18
19
|
@public_columns_hash = {}
|
20
|
+
# descendants only works for already loaded models!
|
19
21
|
descendants.each do |model|
|
20
|
-
|
22
|
+
if files.include?(model.name.underscore) && model.name.underscore != 'application_record'
|
23
|
+
@public_columns_hash[model.name] = model.columns_hash rescue nil # why rescue?
|
24
|
+
end
|
25
|
+
# begin
|
26
|
+
# @public_columns_hash[model.name] = model.columns_hash if model.table_name
|
27
|
+
# rescue Exception => e
|
28
|
+
# binding.pry
|
29
|
+
# @public_columns_hash = nil
|
30
|
+
# raise $!, "Could not read 'columns_hash' for #{model}: #{$!}", $!.backtrace
|
31
|
+
# end if files.include?(model.name.underscore) && model.name.underscore != 'application_record'
|
21
32
|
end
|
22
33
|
@public_columns_hash
|
23
34
|
end
|
35
|
+
|
36
|
+
def self.public_columns_hash_as_json
|
37
|
+
return @public_columns_hash_json if @public_columns_hash_json && Rails.env.production?
|
38
|
+
pch = public_columns_hash
|
39
|
+
return @public_columns_hash_json if @prev_public_columns_hash == pch
|
40
|
+
@prev_public_columns_hash = pch
|
41
|
+
@public_columns_hash_json = pch.to_json
|
42
|
+
end
|
24
43
|
end
|
25
44
|
end
|
@@ -480,7 +480,7 @@ module ReactiveRecord
|
|
480
480
|
def method_missing(method, *args, &block)
|
481
481
|
if [].respond_to? method
|
482
482
|
all.send(method, *args, &block)
|
483
|
-
elsif ScopeDescription.find(@target_klass, method) || (args.count == 1 && method
|
483
|
+
elsif ScopeDescription.find(@target_klass, method) || (args.count == 1 && method.start_with?("find_by_"))
|
484
484
|
apply_scope(method, *args)
|
485
485
|
elsif @target_klass.respond_to?(method) && ScopeDescription.find(@target_klass, "_#{method}")
|
486
486
|
apply_scope("_#{method}", *args).first
|
@@ -56,9 +56,15 @@ module ReactiveRecord
|
|
56
56
|
|
57
57
|
alias convert_string convert_text
|
58
58
|
|
59
|
+
def self.serialized?
|
60
|
+
@serialized_attrs ||= Hash.new { |h, k| h[k] = Hash.new }
|
61
|
+
end
|
62
|
+
|
59
63
|
def convert(attr, val)
|
60
64
|
column_type = column_type(attr)
|
61
|
-
return val if
|
65
|
+
return val if self.class.serialized?[model][attr] ||
|
66
|
+
!column_type || val.loading? ||
|
67
|
+
(!val && column_type != :boolean)
|
62
68
|
conversion_method = "convert_#{column_type}"
|
63
69
|
return send(conversion_method, val) if respond_to? conversion_method
|
64
70
|
val
|
@@ -32,7 +32,7 @@ module ReactiveRecord
|
|
32
32
|
) || 'nil'
|
33
33
|
default_value_method = "build_default_value_for_#{column_type}"
|
34
34
|
@object = __send__ default_value_method
|
35
|
-
rescue Exception
|
35
|
+
rescue ::Exception
|
36
36
|
end
|
37
37
|
|
38
38
|
def build_default_value_for_nil
|
@@ -41,7 +41,7 @@ module ReactiveRecord
|
|
41
41
|
|
42
42
|
def build_default_value_for_datetime
|
43
43
|
if @column_hash[:default]
|
44
|
-
Time.parse(@column_hash[:default].gsub(' ','T')+'+00:00')
|
44
|
+
::Time.parse(@column_hash[:default].gsub(' ','T')+'+00:00')
|
45
45
|
else
|
46
46
|
::ReactiveRecord::Base::DummyValue.dummy_time
|
47
47
|
end
|
@@ -52,7 +52,7 @@ module ReactiveRecord
|
|
52
52
|
|
53
53
|
def build_default_value_for_date
|
54
54
|
if @column_hash[:default]
|
55
|
-
Date.parse(@column_hash[:default])
|
55
|
+
::Date.parse(@column_hash[:default])
|
56
56
|
else
|
57
57
|
::ReactiveRecord::Base::DummyValue.dummy_date
|
58
58
|
end
|
@@ -81,9 +81,9 @@ module ReactiveRecord
|
|
81
81
|
alias build_default_value_for_text build_default_value_for_string
|
82
82
|
|
83
83
|
def notify
|
84
|
-
return if ReactiveRecord::Base.data_loading?
|
85
|
-
ReactiveRecord.loads_pending!
|
86
|
-
ReactiveRecord::WhileLoading.loading!
|
84
|
+
return if ::ReactiveRecord::Base.data_loading?
|
85
|
+
::ReactiveRecord.loads_pending!
|
86
|
+
::ReactiveRecord::WhileLoading.loading!
|
87
87
|
end
|
88
88
|
|
89
89
|
def loading?
|
@@ -107,7 +107,7 @@ module ReactiveRecord
|
|
107
107
|
end
|
108
108
|
|
109
109
|
def method_missing(method, *args, &block)
|
110
|
-
if method
|
110
|
+
if method.start_with?("build_default_value_for_")
|
111
111
|
nil
|
112
112
|
elsif @object || @object.respond_to?(method)
|
113
113
|
notify
|
@@ -155,7 +155,7 @@ module ReactiveRecord
|
|
155
155
|
|
156
156
|
alias inspect to_s
|
157
157
|
|
158
|
-
`#{self}.$$proto.toString =
|
158
|
+
`#{self}.$$proto.toString = Opal.Object.$$proto.toString`
|
159
159
|
|
160
160
|
def to_f
|
161
161
|
notify
|
@@ -182,38 +182,51 @@ module ReactiveRecord
|
|
182
182
|
end
|
183
183
|
|
184
184
|
def self.dummy_time
|
185
|
-
@dummy_time ||= Time.parse('2001-01-01T00:00:00.000-00:00')
|
185
|
+
@dummy_time ||= ::Time.parse('2001-01-01T00:00:00.000-00:00')
|
186
186
|
end
|
187
187
|
|
188
188
|
def self.dummy_date
|
189
|
-
@dummy_date ||= Date.parse('1/1/2001')
|
189
|
+
@dummy_date ||= ::Date.parse('1/1/2001')
|
190
190
|
end
|
191
191
|
|
192
192
|
def to_date
|
193
193
|
notify
|
194
194
|
return @object.to_date if @object
|
195
|
-
ReactiveRecord::Base::DummyValue.dummy_date
|
195
|
+
::ReactiveRecord::Base::DummyValue.dummy_date
|
196
196
|
end
|
197
197
|
|
198
198
|
def to_time
|
199
199
|
notify
|
200
200
|
return @object.to_time if @object
|
201
|
-
ReactiveRecord::Base::DummyValue.dummy_time
|
201
|
+
::ReactiveRecord::Base::DummyValue.dummy_time
|
202
202
|
end
|
203
203
|
|
204
204
|
def acts_as_string?
|
205
|
-
return true if @object.is_a? String
|
206
|
-
return @object.acts_as_string? if @object
|
205
|
+
return true if @object.is_a? ::String
|
206
|
+
return @object.acts_as_string? if @object && @object.respond_to?(:acts_as_string?)
|
207
207
|
true
|
208
208
|
end
|
209
209
|
|
210
|
+
# this is a hackish way and compatible with any other rendered object
|
211
|
+
# to identify a DummyValue during render
|
212
|
+
# in ReactRenderingContext.run_child_block() and
|
213
|
+
# to convert it to a string, for rendering
|
214
|
+
# advantage over a try(:method) is, that it doesnt raise und thus is faster
|
215
|
+
# which is important during render
|
216
|
+
def respond_to?(method)
|
217
|
+
return true if method == :acts_as_string?
|
218
|
+
return true if %i[inspect to_date to_f to_i to_numeric to_number to_s to_time].include? method
|
219
|
+
return @object.respond_to? if @object
|
220
|
+
false
|
221
|
+
end
|
222
|
+
|
210
223
|
def try(*args, &b)
|
211
224
|
if args.empty? && block_given?
|
212
225
|
yield self
|
213
226
|
else
|
214
227
|
__send__(*args, &b)
|
215
228
|
end
|
216
|
-
rescue
|
229
|
+
rescue ::Exception
|
217
230
|
nil
|
218
231
|
end
|
219
232
|
end
|
@@ -52,12 +52,12 @@ module ReactiveRecord
|
|
52
52
|
|
53
53
|
isomorphic_method(:fetch_from_db) do |f, vector|
|
54
54
|
# vector must end with either "*all", or be a simple attribute
|
55
|
-
f.send_to_server [vector.shift.name, *vector] if
|
55
|
+
f.send_to_server [vector.shift.name, *vector] if RUBY_ENGINE == 'opal'
|
56
56
|
f.when_on_server { @server_data_cache[*vector] }
|
57
57
|
end
|
58
58
|
|
59
59
|
isomorphic_method(:find_in_db) do |f, klass, attribute, value|
|
60
|
-
f.send_to_server klass.name, attribute, value if
|
60
|
+
f.send_to_server klass.name, attribute, value if RUBY_ENGINE == 'opal'
|
61
61
|
f.when_on_server { @server_data_cache[klass, ["find_by_#{attribute}", value], :id] }
|
62
62
|
end
|
63
63
|
|
@@ -86,7 +86,7 @@ module ReactiveRecord
|
|
86
86
|
end
|
87
87
|
"<script type='text/javascript'>\n"+
|
88
88
|
"if (typeof window.ReactiveRecordPublicColumnsHash === 'undefined') { \n" +
|
89
|
-
" window.ReactiveRecordPublicColumnsHash = #{ActiveRecord::Base.
|
89
|
+
" window.ReactiveRecordPublicColumnsHash = #{ActiveRecord::Base.public_columns_hash_as_json}}\n" +
|
90
90
|
"if (typeof window.ReactiveRecordInitialData === 'undefined') { window.ReactiveRecordInitialData = [] }\n" +
|
91
91
|
"window.ReactiveRecordInitialData.push(#{json})\n"+
|
92
92
|
"</script>\n"
|
@@ -140,17 +140,17 @@ module ReactiveRecord
|
|
140
140
|
pending_fetches = @pending_fetches.uniq
|
141
141
|
models, associations = gather_records(@pending_records, false, nil)
|
142
142
|
log(["Server Fetching: %o", pending_fetches.to_n])
|
143
|
-
start_time =
|
144
|
-
Operations::Fetch(models: models, associations: associations, pending_fetches: pending_fetches)
|
143
|
+
start_time = `Date.now()`
|
144
|
+
Operations::Fetch.run(models: models, associations: associations, pending_fetches: pending_fetches)
|
145
145
|
.then do |response|
|
146
|
-
fetch_time =
|
147
|
-
log(" Fetched in: #{(fetch_time-start_time)
|
146
|
+
fetch_time = `Date.now()`
|
147
|
+
log(" Fetched in: #{`(fetch_time - start_time)/ 1000`}s")
|
148
148
|
begin
|
149
149
|
ReactiveRecord::Base.load_from_json(response)
|
150
150
|
rescue Exception => e
|
151
151
|
log("Unexpected exception raised while loading json from server: #{e}", :error)
|
152
152
|
end
|
153
|
-
log(" Processed in: #{(
|
153
|
+
log(" Processed in: #{`(Date.now() - fetch_time) / 1000`}s")
|
154
154
|
log([" Returned: %o", response.to_n])
|
155
155
|
ReactiveRecord.run_blocks_to_load last_fetch_at
|
156
156
|
ReactiveRecord::WhileLoading.loaded_at last_fetch_at
|
@@ -256,7 +256,7 @@ module ReactiveRecord
|
|
256
256
|
backing_records.each { |id, record| record.saving! }
|
257
257
|
|
258
258
|
promise = Promise.new
|
259
|
-
Operations::Save(models: models, associations: associations, validate: validate)
|
259
|
+
Operations::Save.run(models: models, associations: associations, validate: validate)
|
260
260
|
.then do |response|
|
261
261
|
begin
|
262
262
|
response[:models] = response[:saved_models].collect do |item|
|
@@ -434,6 +434,7 @@ module ReactiveRecord
|
|
434
434
|
#puts "!!!!!!!!!!!!associations updated"
|
435
435
|
|
436
436
|
has_errors = false
|
437
|
+
error_messages = []
|
437
438
|
|
438
439
|
#puts "ready to start saving... dont_save_list = #{dont_save_list}"
|
439
440
|
|
@@ -446,18 +447,28 @@ module ReactiveRecord
|
|
446
447
|
#puts "has_errors before = #{has_errors}, validate= #{validate}, !valid= #{!valid} (validate and !valid) #{validate and !valid}"
|
447
448
|
has_errors ||= (validate and !valid)
|
448
449
|
#puts "validation complete errors = <#{!valid}>, #{model.errors.messages} has_errors #{has_errors}"
|
450
|
+
error_messages << [model, model.errors.messages] unless valid
|
449
451
|
[reactive_record_id, model.class.name, model.attributes, (valid ? nil : model.errors.messages)]
|
450
452
|
elsif model and (!model.id or model.changed?)
|
451
453
|
#puts "saving #{model.class.name} #{model} (reactive_record_id = #{reactive_record_id})"
|
452
454
|
saved = model.check_permission_with_acting_user(acting_user, new_models.include?(model) ? :create_permitted? : :update_permitted?).save(validate: validate)
|
453
455
|
has_errors ||= !saved
|
454
456
|
messages = model.errors.messages if (validate and !saved) or (!validate and !model.valid?)
|
457
|
+
error_messages << [model, messages] if messages
|
455
458
|
#puts "saved complete errors = <#{!saved}>, #{messages} has_errors #{has_errors}"
|
456
459
|
[reactive_record_id, model.class.name, model.attributes, messages]
|
457
460
|
end
|
458
461
|
end.compact
|
459
462
|
|
460
|
-
|
463
|
+
if has_errors
|
464
|
+
::Rails.logger.debug "\033[0;31;1mERROR: HyperModel saving records failed:\033[0;30;21m"
|
465
|
+
error_messages.each do |model, messages|
|
466
|
+
messages.each do |message|
|
467
|
+
::Rails.logger.debug "\033[0;31;1m\t#{model}: #{message}\033[0;30;21m"
|
468
|
+
end
|
469
|
+
end
|
470
|
+
raise "HyperModel saving records failed!"
|
471
|
+
end
|
461
472
|
|
462
473
|
if save
|
463
474
|
|
@@ -465,7 +476,7 @@ module ReactiveRecord
|
|
465
476
|
|
466
477
|
else
|
467
478
|
|
468
|
-
vectors.each { |vector, model| model.reload unless model.nil? or model.new_record? or model.frozen? }
|
479
|
+
# vectors.each { |vector, model| model.reload unless model.nil? or model.new_record? or model.frozen? }
|
469
480
|
vectors
|
470
481
|
|
471
482
|
end
|
@@ -496,7 +507,7 @@ module ReactiveRecord
|
|
496
507
|
promise = Promise.new
|
497
508
|
|
498
509
|
if !data_loading? and (id or vector)
|
499
|
-
Operations::Destroy(model: ar_instance.model_name, id: id, vector: vector)
|
510
|
+
Operations::Destroy.run(model: ar_instance.model_name, id: id, vector: vector)
|
500
511
|
.then do |response|
|
501
512
|
Broadcast.to_self ar_instance
|
502
513
|
yield response[:success], response[:message] if block
|