Skip to content

Commit 6a01640

Browse files
committed
closes #126
1 parent 5f0e76c commit 6a01640

File tree

4 files changed

+30
-23
lines changed

4 files changed

+30
-23
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
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
class ActiveRecord::Base
2+
def new?
3+
raise 'Hypermodel internally using the deprecated new? method'
4+
end
5+
end

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)