Skip to content

Commit 513b0f5

Browse files
committed
Merge branch 'issue-126' into issue-194
2 parents 5552717 + c938651 commit 513b0f5

File tree

5 files changed

+27
-25
lines changed

5 files changed

+27
-25
lines changed

ruby/hyper-model/lib/reactive_record/active_record/reactive_record/backing_record_inspector.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ module ReactiveRecord
44
# the appropriate string. The order of execution is important!
55
module BackingRecordInspector
66
def inspection_details
7-
return error_details unless errors.empty?
8-
return new_details if new?
7+
return error_details unless errors.empty?
8+
return new_details if new?
99
return destroyed_details if destroyed
10-
return loading_details unless @attributes.key? primary_key
11-
return dirty_details unless changed_attributes.empty?
10+
return loading_details unless @attributes.key? primary_key
11+
return dirty_details unless changed_attributes.empty?
1212
"[loaded id: #{id}]"
1313
end
1414

ruby/hyper-model/lib/reactive_record/active_record/reactive_record/collection.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ def internal_replace(new_array)
540540
@dummy_collection.notify
541541
array = new_array.is_a?(Collection) ? new_array.collection : new_array
542542
@collection.each_with_index do |r, i|
543-
r.id = new_array[i].id if array[i] and array[i].id and !r.new? and r.backing_record.vector.last =~ /^\*[0-9]+$/
543+
r.id = new_array[i].id if array[i] and array[i].id and !r.new_record? and r.backing_record.vector.last =~ /^\*[0-9]+$/
544544
end
545545
end
546546
# the following makes sure that the existing elements are properly removed from the collection

ruby/hyper-model/lib/reactive_record/active_record/reactive_record/isomorphic_base.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ def self.gather_records(records_to_process, force, record_being_saved)
233233
if association.collection?
234234
# following line changed from .all to .collection on 10/28
235235
[*value.collection, *value.unsaved_children].each do |assoc|
236-
add_new_association.call(record, attribute, assoc.backing_record) if assoc.changed?(association.inverse_of(assoc)) or assoc.new?
236+
add_new_association.call(record, attribute, assoc.backing_record) if assoc.changed?(association.inverse_of(assoc)) or assoc.new_record?
237237
end
238238
elsif record.new? || record.changed?(attribute) || (record == record_being_saved && force)
239239
if value.nil?

ruby/hyper-model/lib/reactive_record/broadcast.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ class SendPacket < Hyperstack::ServerOp
7272

7373
def self.to_self(record, data = {})
7474
# simulate incoming packet after a local save
75-
operation = if record.new?
75+
operation = if record.new_record?
7676
:create
7777
elsif record.destroyed?
7878
:destroy

ruby/rails-hyperstack/rails-hyperstack.gemspec

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -23,34 +23,36 @@ Gem::Specification.new do |spec|
2323
2424
Welcome to Hyperstack!
2525
26-
For a complete install run
26+
For a quick start simply add a component using one of the generators:
2727
28-
bundle exec rails hyperstack:install
28+
>> bundle exec rails generate hyper:component CompName --add-route=/test/(*others)
29+
# Add a new component named CompName and route to it with /test/
2930
30-
You can also add components directly using generators:
31-
32-
bundle exec rails generate hyper:component CompName --add-route=/test/(*others)
33-
# Add a new component named CompName and route to it with /test/
34-
35-
bundle exec rails generate hyper:router CompName --add-route=/test/(*others)
36-
# Add a top level router named CompName
37-
bundle exec rails
31+
>> bundle exec rails generate hyper:router CompName --add-route=/test/(*others)
32+
# Add a top level router named CompName
3833
3934
The generators will insure you have the minimal additions to your system for the
4035
new component to run. And note: --add-route is optional.
4136
42-
The hyperstack:install task also has options to control how much of the `Stack
43-
gets installed:
37+
For a complete install run the hyperstack install task:
38+
39+
>> bundle exec rails hyperstack:install
40+
41+
This will add everything you need including the hotloader, webpack integration,
42+
hyper-model (active record model client synchronization) and a top level
43+
component to get you started.
44+
45+
You can control how much of the stack gets installed using these options:
4446
45-
--skip-hotloader # don't add the hotloader
46-
--skip-webpack # don't add webpack
47-
--skip-hyper-model # don't add hyper-model and default policy files
47+
--skip-hotloader # don't add the hotloader
48+
--skip-webpack # don't add webpack
49+
--skip-hyper-model # don't add hyper-model and default policy files
4850
4951
You can always install these pieces later using these options:
5052
51-
--hotloader-only # just add the hotloader
52-
--webpack-only # just add webpack
53-
--hyper-model-only # just add hyper-model, and default policy files
53+
--hotloader-only # just add the hotloader
54+
--webpack-only # just add webpack
55+
--hyper-model-only # just add hyper-model, and default policy files
5456
5557
*******************************************************************************
5658
}

0 commit comments

Comments
 (0)