Skip to content
This repository has been archived by the owner on Apr 17, 2018. It is now read-only.

ArgumentError: options[:field] entry does not map to a property in Model #227

Open
postmodern opened this issue Sep 29, 2012 · 0 comments
Open

Comments

@postmodern
Copy link
Member

While testing ronin-scanners I ran into this error when accessing the ports relationship on IPAddress, which goes through OpenPort.

ip = IPAddress.last
# => #<Ronin::IPAddress: 173.194.33.0>
ip.open_ports
# => [#<Ronin::OpenPort @id=6 @last_scanned_at=2012-09-28 00:00:00 -0700 @created_at=#<DateTime: 2012-09-28T22:26:14-07:00 ((2456200j,19574s,0n),-25200s,2299161j)> @ip_address_id=11 @port_id=2 @service_id=1>, #<Ronin::OpenPort @id=7 @last_scanned_at=2012-09-28 00:00:00 -0700 @created_at=#<DateTime: 2012-09-28T22:26:14-07:00 ((2456200j,19574s,0n),-25200s,2299161j)> @ip_address_id=11 @port_id=1 @service_id=1>]
ip.ports
ArgumentError: +options[:field]+ entry :protocol does not map to a property in Ronin::Port
/home/hal/.gem/ruby/1.9.1/gems/dm-core-1.2.0/lib/dm-core/query.rb:805:in `block in assert_valid_fields'
/home/hal/.gem/ruby/1.9.1/gems/dm-core-1.2.0/lib/dm-core/query.rb:796:in `each'
/home/hal/.gem/ruby/1.9.1/gems/dm-core-1.2.0/lib/dm-core/query.rb:796:in `assert_valid_fields'
/home/hal/.gem/ruby/1.9.1/gems/dm-aggregates-1.2.0/lib/dm-aggregates/query.rb:23:in `assert_valid_fields_with_operator'
/home/hal/.gem/ruby/1.9.1/gems/dm-core-1.2.0/lib/dm-core/query.rb:768:in `block in assert_valid_options'
/home/hal/.gem/ruby/1.9.1/gems/dm-core-1.2.0/lib/dm-core/query.rb:766:in `each'
/home/hal/.gem/ruby/1.9.1/gems/dm-core-1.2.0/lib/dm-core/query.rb:766:in `assert_valid_options'
/home/hal/.gem/ruby/1.9.1/gems/dm-core-1.2.0/lib/dm-core/query.rb:363:in `update'
/home/hal/.gem/ruby/1.9.1/gems/dm-core-1.2.0/lib/dm-core/associations/relationship.rb:158:in `block in query_for'
/home/hal/.gem/ruby/1.9.1/gems/dm-core-1.2.0/lib/dm-core/repository.rb:114:in `scope'
/home/hal/.gem/ruby/1.9.1/gems/dm-core-1.2.0/lib/dm-core/associations/relationship.rb:153:in `query_for'
/home/hal/.gem/ruby/1.9.1/gems/dm-core-1.2.0/lib/dm-core/associations/one_to_many.rb:40:in `collection_for'
/home/hal/.gem/ruby/1.9.1/gems/dm-core-1.2.0/lib/dm-core/associations/one_to_many.rb:99:in `lazy_load'
/home/hal/.gem/ruby/1.9.1/gems/dm-core-1.2.0/lib/dm-core/resource/persistence_state/persisted.rb:23:in `lazy_load'
/home/hal/.gem/ruby/1.9.1/gems/dm-core-1.2.0/lib/dm-core/resource/persistence_state/persisted.rb:8:in `get'
/home/hal/.gem/ruby/1.9.1/gems/dm-core-1.2.0/lib/dm-core/model/relationship.rb:340:in `ports'
(ronin):3:in `start'

I get the same error when calling ip.open_ports.ports and after calling DataMapper.finalize. I have also ran into this error in a Padrino app that also used DataMapper 1.2.0.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant