Skip to content

Commit 28d3feb

Browse files
committed
closes #163 and fixes another association problem
1 parent b0bed77 commit 28d3feb

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,8 @@ def find_inverse(model) # private
182182

183183
def klass(model = nil)
184184
@klass ||= Object.const_get(@klass_name) if @klass_name
185-
if @klass && model && !(model.class <= @klass)
185+
if @klass && model && !(model.class <= @klass || @klass <= model.class)
186+
# TODO: added || @klass <= model.class can both cases really happen I guess so
186187
raise "internal error: provided model #{model} is not subclass of #{@klass}"
187188
end
188189
raise 'no model supplied for polymorphic relationship' unless @klass || model

ruby/hyperstack-config/lib/hyperstack-hotloader-config.js.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ if ((typeof(window) !== 'undefined') && (window.Hyperstack==undefined || window.
33
}
44
//if (typeof(Hyperstack) === 'undefined') { Hyperstack = {} }
55
Hyperstack.hotloader.port = <%= Hyperstack.hotloader_port %>
6-
Hyperstack.hotloader.ping = <%= !!Hyperstack.hotloader_ping %>
6+
Hyperstack.hotloader.ping = <%= Hyperstack.hotloader_ping ? Hyperstack.hotloader_ping : false %>
77
Hyperstack.hotloader.ignore_callback_mapping = <%= !(!Hyperstack.hotloader_ignore_callback_mapping && Rails.configuration.assets.debug) %>

ruby/hyperstack-config/lib/hyperstack/hotloader/short_cut.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ if (typeof window !== 'undefined') {
44
Opal.Hyperstack.$const_get('Hotloader').$listen(port || 25222, ping || Opal.nil)
55
}
66
}
7-
} else {
7+
} /* else {
88
throw 'Attempt to run hotloader during prerendering - make sure you import with the `client_only: true` option'
9-
}
9+
} */

0 commit comments

Comments
 (0)