From 7837013d140d4c4bb8aa8de42f52dafdd5a2be72 Mon Sep 17 00:00:00 2001 From: Yannick Date: Wed, 9 Jul 2014 15:22:43 -0600 Subject: [PATCH] Created a lib directory and added entity_resource.rb as well as query_resource.rb. --- lib/entity_resource.rb | 7 +++++++ lib/query_resource.rb | 10 ++++++++++ 2 files changed, 17 insertions(+) create mode 100644 lib/entity_resource.rb create mode 100644 lib/query_resource.rb diff --git a/lib/entity_resource.rb b/lib/entity_resource.rb new file mode 100644 index 0000000..cbebcd6 --- /dev/null +++ b/lib/entity_resource.rb @@ -0,0 +1,7 @@ +require 'active_resource' + +class EntityResource < ActiveResource::Base + self.site ='http://localhost:3000' + self.element_name = "entity" + +end \ No newline at end of file diff --git a/lib/query_resource.rb b/lib/query_resource.rb new file mode 100644 index 0000000..decfee1 --- /dev/null +++ b/lib/query_resource.rb @@ -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 \ No newline at end of file