You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Given the following erroneous resource definitions:
class Document < ActiveRecord::Base
belongs_to User
end
class User < ActiveRecord::BAse
end
module Resources
class Document
model ::Document
end
I would hope that praxis-mapper would check its model map for nil before calling methods and perhaps raise an easy-to-understand error such as "you're missing a resource definition, you ninny!" Instead I get a gnarly backtrace that I must decode myself:
#<NoMethodError: undefined method `properties' for nil:NilClass>
praxis-mapper-b73ad03c2606/lib/praxis-mapper/selector_generator.rb:30:in `map_property'
praxis-mapper-b73ad03c2606/lib/praxis-mapper/selector_generator.rb:21:in `block in add'
praxis-mapper-b73ad03c2606/lib/praxis-mapper/selector_generator.rb:20:in `each'
praxis-mapper-b73ad03c2606/lib/praxis-mapper/selector_generator.rb:20:in `add'
praxis-mapper-b73ad03c2606/lib/praxis-mapper/selector_generator.rb:87:in `add_association'
praxis-mapper-b73ad03c2606/lib/praxis-mapper/selector_generator.rb:33:in `map_property'
praxis-mapper-b73ad03c2606/lib/praxis-mapper/selector_generator.rb:21:in `block in add'
praxis-mapper-b73ad03c2606/lib/praxis-mapper/selector_generator.rb:20:in `each'
praxis-mapper-b73ad03c2606/lib/praxis-mapper/selector_generator.rb:20:in `add'
praxis-mapper-b73ad03c2606/lib/praxis-mapper/identity_map.rb:557:in `add_selectors'
praxis-f677785df9f2/lib/praxis/extensions/mapper_selectors.rb:12:in `set_selectors'
app/controllers/test.rb:15:in `block (2 levels) in <module:Test>'
The text was updated successfully, but these errors were encountered:
Given the following erroneous resource definitions:
I would hope that praxis-mapper would check its model map for nil before calling methods and perhaps raise an easy-to-understand error such as "you're missing a resource definition, you ninny!" Instead I get a gnarly backtrace that I must decode myself:
The text was updated successfully, but these errors were encountered: