typus 3.1.0.rc5 → 3.1.0.rc6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -153,7 +153,7 @@ class Admin::ResourcesController < Admin::BaseController
|
|
153
153
|
@resource = @resource.where(condition)
|
154
154
|
end
|
155
155
|
|
156
|
-
@resource.
|
156
|
+
@resource.build_my_joins(params).each do |join|
|
157
157
|
@resource = @resource.joins(join)
|
158
158
|
end
|
159
159
|
|
data/lib/typus/version.rb
CHANGED
@@ -297,7 +297,7 @@ class ActiveRecordTest < ActiveSupport::TestCase
|
|
297
297
|
|
298
298
|
end
|
299
299
|
|
300
|
-
context "
|
300
|
+
context "build_my_joins" do
|
301
301
|
|
302
302
|
setup do
|
303
303
|
@project = Factory(:project)
|
@@ -306,7 +306,7 @@ class ActiveRecordTest < ActiveSupport::TestCase
|
|
306
306
|
|
307
307
|
should "return the expected joins" do
|
308
308
|
params = { :projects => @project.id }
|
309
|
-
assert_equal [:projects], User.
|
309
|
+
assert_equal [:projects], User.build_my_joins(params)
|
310
310
|
end
|
311
311
|
|
312
312
|
##
|
@@ -318,7 +318,7 @@ class ActiveRecordTest < ActiveSupport::TestCase
|
|
318
318
|
|
319
319
|
@resource = User
|
320
320
|
@resource.build_conditions(params).each { |c| @resource = @resource.where(c) }
|
321
|
-
@resource.
|
321
|
+
@resource.build_my_joins(params).each { |j| @resource = @resource.joins(j) }
|
322
322
|
|
323
323
|
assert_equal [@project.user.id], @resource.map(&:id)
|
324
324
|
end
|