Skip to content

Commit 9268e32

Browse files
committed
added association naming spec
1 parent 236dccd commit 9268e32

File tree

4 files changed

+17
-11
lines changed

4 files changed

+17
-11
lines changed

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ def build_child_scope(scope_description, *scope_vector)
273273
end
274274

275275
def link_to_parent
276-
puts "#{self}.link_to_parent @linked = #{!!@linked}, collection? #{!!@collection}"
276+
# puts "#{self}.link_to_parent @linked = #{!!@linked}, collection? #{!!@collection}"
277277
# always check that parent is synced - fixes issue https://github.com/hyperstack-org/hyperstack/issues/82
278278
# note that sync_collection_with_parent checks to make sure that is NOT a collection and that there IS a parent
279279

@@ -294,23 +294,23 @@ def link_child(child)
294294
end
295295

296296
def sync_collection_with_parent
297-
puts "#{self}.sync_collection_with_parent"
297+
# puts "#{self}.sync_collection_with_parent"
298298
return if @collection || !@parent || @parent.dummy_collection # fixes issue https://github.com/hyperstack-org/hyperstack/issues/78 and supports /82
299299
if @parent.collection
300-
puts ">>> @parent.collection present"
300+
# puts ">>> @parent.collection present"
301301
if @parent.collection.empty?
302-
puts ">>>>> @parent.collection is empty!"
302+
# puts ">>>>> @parent.collection is empty!"
303303
@collection = []
304304
elsif filter?
305-
puts "#{self}.sync_collection_with_parent (@parent = #{@parent}) calling filter records on (#{@parent.collection})"
306-
@collection = filter_records(@parent.collection).tap { |rr| puts "returns #{rr} #{rr.to_a}" }
305+
# puts "#{self}.sync_collection_with_parent (@parent = #{@parent}) calling filter records on (#{@parent.collection})"
306+
@collection = filter_records(@parent.collection) # .tap { |rr| puts "returns #{rr} #{rr.to_a}" }
307307
end
308308
elsif !@linked && @parent._count_internal(false).zero?
309309
# don't check _count_internal if already linked as this cause an unnecessary rendering cycle
310-
puts ">>> @parent._count_internal(false).zero? is true!"
310+
# puts ">>> @parent._count_internal(false).zero? is true!"
311311
@count = 0
312312
else
313-
puts ">>> NOP"
313+
# puts ">>> NOP"
314314
end
315315
end
316316

ruby/hyper-model/spec/batch7/association_naming_xspec.rb renamed to ruby/hyper-model/spec/batch7/association_naming_spec.rb

File renamed without changes.

ruby/hyper-model/spec/batch7/sti_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@ class ApplicationPolicy
2323
regulate_all_broadcasts { |policy| policy.send_all }
2424
allow_change(to: :all, on: [:create, :update, :destroy]) { true }
2525
end
26-
end
27-
28-
before(:each) do
2926

3027
class ActiveRecord::Base
3128
class << self
@@ -34,6 +31,9 @@ def public_columns_hash
3431
end
3532
end
3633
end
34+
end
35+
36+
before(:each) do
3737

3838
isomorphic do
3939

ruby/hyper-model/spec/spec_helper.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,12 @@ class ActiveRecord::Base
286286
#size_window(:default)
287287
end
288288

289+
config.before(:all) do
290+
# reset this variable so if any specs are setting up models locally
291+
# the correct has gets sent to the client.
292+
ActiveRecord::Base.instance_variable_set('@public_columns_hash', nil)
293+
end
294+
289295
config.after(:each, :js => true) do
290296
page.instance_variable_set("@hyper_spec_mounted", false)
291297
end

0 commit comments

Comments
 (0)