Created a lib directory and added entity_resource.rb as well as query_resource.rb.
This commit is contained in:
parent
f0b7703950
commit
7837013d14
|
@ -0,0 +1,7 @@
|
||||||
|
require 'active_resource'
|
||||||
|
|
||||||
|
class EntityResource < ActiveResource::Base
|
||||||
|
self.site ='http://localhost:3000'
|
||||||
|
self.element_name = "entity"
|
||||||
|
|
||||||
|
end
|
|
@ -0,0 +1,10 @@
|
||||||
|
require 'active_resource'
|
||||||
|
|
||||||
|
class QueryResource < ActiveResource::Base
|
||||||
|
self.site ='http://localhost:3000'
|
||||||
|
self.element_name = "query"
|
||||||
|
has_many :entities, class_name: 'EntityResource'
|
||||||
|
def to_param
|
||||||
|
self.identifier
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in New Issue