{"id":3024,"date":"2019-04-15T08:52:00","date_gmt":"2019-04-15T08:52:00","guid":{"rendered":"http:\/\/the-codest.localhost\/blog\/active-record-query-interface\/"},"modified":"2026-04-24T11:39:17","modified_gmt":"2026-04-24T11:39:17","slug":"aktivo-ierakstu-vaicajuma-saskarne","status":"publish","type":"post","link":"https:\/\/thecodest.co\/lv\/blog\/active-record-query-interface\/","title":{"rendered":"Akt\u012bv\u0101 ieraksta vaic\u0101juma saskarne"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Some context to begin with<\/h2>\n\n\n\n<p>This article is inspired by a real problem I\u2019ve once been tasked with. Dealing with it taught me a lot, and I still have it as a reference in my mind. I think examples are a good learning resource, they can clarify a lot. In this article, I\u2019d like to share with you some examples of using the Active Record query methods.<\/p>\n\n\n\n<p>In order not to introduce domain-specific details, I\u2019ll use a sample application for a library to illustrate examples. It\u2019s all fairly simple, as shown in the diagram below. We have four tables: authors, books, users and rentals. One user can borrow many books and one book can be borrowed by many users, so we need a joining table to model many-to-many relationships. It\u2019s the rentals table in our case. We also store some additional info there, which are the dates of borrowing and return. An author can have many books assigned to their name. A book also has an attribute defining its genre.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"\/app\/uploads\/2024\/05\/Active-Record-Query.png\" alt=\"\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">User reading statistics<\/h2>\n\n\n\n<p>The task was to prepare statistics for a single user, so we could tell how many books from each genre were borrowed. My first thought was to fetch all books which have been borrowed by the user, group them by their genre and then do the mapping, so each genre has a number of books assigned instead of a list. Here is what I came up with:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"ruby\" class=\"language-ruby\">Hash[Book.joins(:rentals).where(rentals: { user: user }).group_by(&amp;:genre).map { |genre, books| [genre, books.size] }]<\/code><\/pre>\n\n\n\n<p>While this approach works and looks clean, it doesn\u2019t use all the possibilities that Active Record query methods offer. Thanks to them, we\u2019re able to filter and aggregate <a href=\"https:\/\/thecodest.co\/lv\/blog\/app-data-collection-security-risks-value-and-types-explored\/\">data<\/a> on a database level without using raw SQL directly in our <a href=\"https:\/\/thecodest.co\/lv\/dictionary\/what-is-code-refactoring\/\">code<\/a>. Operating on a db level also increases our efficiency.<\/p>\n\n\n\n<p>In the example above, we can use the group method instead of the Ruby\u2019s group<em>by method. It will apply tthe GROUP<\/em>BY clause to the tSQL query. Furthermore, the mapping and size method can be replaced with a count aggregation function. In the end, we are left with a query that looks like this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"ruby\" class=\"language-ruby\">Book.joins(:rentals).where(rentals: { user: user }).group(:genre).count(:books)<\/code><\/pre>\n\n\n\n<p>It looks even simpler!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Other useful examples<\/h2>\n\n\n\n<p>Below you\u2019ll find some other ways of using the query methods which I find worth knowing.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Invitation for inactive users<\/h3>\n\n\n\n<p>TASK: Filter users who have never borrowed a book or did it more than a year ago.<\/p>\n\n\n\n<p>We could fetch all users by including the associated rentals and then filter them using the select method.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"ruby\" class=\"language-ruby\">User.includes(:rentals).select do |user|\n user.rentals.empty? || user.rentals.none? { |rental| rental.start_date >= Date.today - 1.year }\nend<code> <\/code><\/code><\/pre>\n\n\n\n<p>But, of course, there is no need to fetch everything. By using the query methods, we can filter it out on the db level. First, let\u2019s select users who have borrowed some books in the last year and then exclude them from the final selection.<\/p>\n\n\n\n<p>This is how the subquery will look like:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"ruby\" class=\"language-ruby\">User.joins(:rentals).where(rentals: { start_date:  (Date.today - 1.year).Date.today })<\/code><\/pre>\n\n\n\n<p>And now, let\u2019s put it all together:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"ruby\" class=\"language-ruby\">User.where.not(id: [User.joins(:rentals).where(rentals: { start_date:  (Date.today - 1.year)..Date.today })])<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Underrepresented authors<\/h2>\n\n\n\n<p>TASK: Get authors with one or zero borrowed books<\/p>\n\n\n\n<p>Doing it with the select method is super simple, but again \u2013 there is no need to operate on such a big set of data as the db can filter it for <a href=\"https:\/\/thecodest.co\/lv\/blog\/why-us-companies-are-opting-for-polish-developers\/\">us<\/a>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"ruby\" class=\"language-ruby\">Author.includes(:books).select { |author| author.books.size &lt;= 1 }<\/code><\/pre>\n\n\n\n<p>Then, filtering authors with zero books assigned is quick and easy:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"ruby\" class=\"language-ruby\"><code>Author.left_joins(:books).where(books: { id: nil })<\/code><\/code><\/pre>\n\n\n\n<p>It\u2019s important to remember one thing while using the left_joins (and outer joins in general). If there are records in the left table (here: authors) that don\u2019t have corresponding records in the right table (here: books), then in result the right table columns will be populated with nil values.<\/p>\n\n\n\n<p>As we also need authors with one book assigned in the system, there are a few more operations to do. We\u2019ll have to do the grouping, counting and adding a condition. Here is how to put it all together:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">Author.left_joins(:books).group(:id).having(\"count(*) &lt;= ?\", 1)<\/code><\/pre>\n\n\n\n<p>The condition comes after the aggregation function, so we have to use the HAVING clause, instead of the WHERE clause to specify it.<\/p>\n\n\n\n<p>The Active Record query methods are worth checking when thinking about application performance. They can simplify your code and make it work faster. I hope that the shared examples will help you in exploring the possibilities the query methods have to offer.<\/p>\n\n\n\n<p><strong>Read more:<\/strong><\/p>\n\n\n\n<p>&#8211; <a href=\"https:\/\/thecodest.co\/blog\/an-era-of-remote-work-has-started-a-month-ago\/\">Time for a new reality. An era of remote work has started a month ago<\/a><\/p>\n\n\n\n<p>&#8211; <a href=\"https:\/\/thecodest.co\/blog\/need-to-use-the-common-js-frameworks-in-your-rails-app\/\">Need to use the common JS frameworks in your Rails app? Stimulus.js may be an alternative<\/a><\/p>\n\n\n\n<p>&#8211; <a href=\"https:\/\/thecodest.co\/blog\/web-app-development-why-is-ruby-on-rails-a-technology-worth-choosing\/\">Web App Development: Why is Ruby on Rails a technology worth choosing?<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Veiktsp\u0113ja ir viens no svar\u012bg\u0101kajiem aspektiem, kas j\u0101\u0146em v\u0113r\u0101, izstr\u0101d\u0101jot t\u012bmek\u013ca lietojumprogrammas. Analiz\u0113jot, k\u0101 dati tiek sa\u0146emti no datub\u0101zes, ir labs s\u0101kumpunkts, mekl\u0113jot uzlabojumus. \u0160aj\u0101 rakst\u0101 atrad\u012bsiet piem\u0113rus, k\u0101 uzlabot veiktsp\u0113ju, izmantojot apkopojo\u0161\u0101s funkcijas un filtr\u0113jot datus datub\u0101zes l\u012bmen\u012b.<\/p>","protected":false},"author":2,"featured_media":3025,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[8],"tags":[],"class_list":["post-3024","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-software-development"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.3 (Yoast SEO v27.3) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Active Record Query Interface - The Codest<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/thecodest.co\/lv\/emuars\/aktivo-ierakstu-vaicajuma-saskarne\/\" \/>\n<meta property=\"og:locale\" content=\"lv_LV\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Active Record Query Interface\" \/>\n<meta property=\"og:description\" content=\"Performance is one of most important aspects to take into account when developing web applications. Analyzing how data is fetched from a database is a good starting point when looking for enhancements. In this article, you\u2019ll find examples on how to improve the performance by using aggregate functions and filtering data on a database level.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/thecodest.co\/lv\/emuars\/aktivo-ierakstu-vaicajuma-saskarne\/\" \/>\n<meta property=\"og:site_name\" content=\"The Codest\" \/>\n<meta property=\"article:published_time\" content=\"2019-04-15T08:52:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-04-24T11:39:17+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/thecodest.co\/app\/uploads\/2024\/05\/cover-image-12.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"600\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"thecodest\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"thecodest\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 min\u016btes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/active-record-query-interface\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/active-record-query-interface\\\/\"},\"author\":{\"name\":\"thecodest\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/#\\\/schema\\\/person\\\/7e3fe41dfa4f4e41a7baad4c6e0d4f76\"},\"headline\":\"Active Record Query Interface\",\"datePublished\":\"2019-04-15T08:52:00+00:00\",\"dateModified\":\"2026-04-24T11:39:17+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/active-record-query-interface\\\/\"},\"wordCount\":740,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/active-record-query-interface\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/thecodest.co\\\/app\\\/uploads\\\/2024\\\/05\\\/cover-image-12.jpg\",\"articleSection\":[\"Software Development\"],\"inLanguage\":\"lv-LV\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/thecodest.co\\\/blog\\\/active-record-query-interface\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/active-record-query-interface\\\/\",\"url\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/active-record-query-interface\\\/\",\"name\":\"Active Record Query Interface - The Codest\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/active-record-query-interface\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/active-record-query-interface\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/thecodest.co\\\/app\\\/uploads\\\/2024\\\/05\\\/cover-image-12.jpg\",\"datePublished\":\"2019-04-15T08:52:00+00:00\",\"dateModified\":\"2026-04-24T11:39:17+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/active-record-query-interface\\\/#breadcrumb\"},\"inLanguage\":\"lv-LV\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/thecodest.co\\\/blog\\\/active-record-query-interface\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"lv-LV\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/active-record-query-interface\\\/#primaryimage\",\"url\":\"https:\\\/\\\/thecodest.co\\\/app\\\/uploads\\\/2024\\\/05\\\/cover-image-12.jpg\",\"contentUrl\":\"https:\\\/\\\/thecodest.co\\\/app\\\/uploads\\\/2024\\\/05\\\/cover-image-12.jpg\",\"width\":1200,\"height\":600},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/blog\\\/active-record-query-interface\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/thecodest.co\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Active Record Query Interface\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/#website\",\"url\":\"https:\\\/\\\/thecodest.co\\\/\",\"name\":\"The Codest\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/thecodest.co\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"lv-LV\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/#organization\",\"name\":\"The Codest\",\"url\":\"https:\\\/\\\/thecodest.co\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"lv-LV\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/thecodest.co\\\/app\\\/uploads\\\/2024\\\/03\\\/thecodest-logo.svg\",\"contentUrl\":\"https:\\\/\\\/thecodest.co\\\/app\\\/uploads\\\/2024\\\/03\\\/thecodest-logo.svg\",\"width\":144,\"height\":36,\"caption\":\"The Codest\"},\"image\":{\"@id\":\"https:\\\/\\\/thecodest.co\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/pl.linkedin.com\\\/company\\\/codest\",\"https:\\\/\\\/clutch.co\\\/profile\\\/codest\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/thecodest.co\\\/#\\\/schema\\\/person\\\/7e3fe41dfa4f4e41a7baad4c6e0d4f76\",\"name\":\"thecodest\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"lv-LV\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5dbfe6a1e8c86e432e8812759e34e6fe82ebac75119ae3237a6c1311fa19caf4?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5dbfe6a1e8c86e432e8812759e34e6fe82ebac75119ae3237a6c1311fa19caf4?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/5dbfe6a1e8c86e432e8812759e34e6fe82ebac75119ae3237a6c1311fa19caf4?s=96&d=mm&r=g\",\"caption\":\"thecodest\"},\"url\":\"https:\\\/\\\/thecodest.co\\\/lv\\\/author\\\/thecodest\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Akt\u012bv\u0101 ieraksta vaic\u0101juma saskarne - The Codest","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/thecodest.co\/lv\/emuars\/aktivo-ierakstu-vaicajuma-saskarne\/","og_locale":"lv_LV","og_type":"article","og_title":"Active Record Query Interface","og_description":"Performance is one of most important aspects to take into account when developing web applications. Analyzing how data is fetched from a database is a good starting point when looking for enhancements. In this article, you\u2019ll find examples on how to improve the performance by using aggregate functions and filtering data on a database level.","og_url":"https:\/\/thecodest.co\/lv\/emuars\/aktivo-ierakstu-vaicajuma-saskarne\/","og_site_name":"The Codest","article_published_time":"2019-04-15T08:52:00+00:00","article_modified_time":"2026-04-24T11:39:17+00:00","og_image":[{"width":1200,"height":600,"url":"https:\/\/thecodest.co\/app\/uploads\/2024\/05\/cover-image-12.jpg","type":"image\/jpeg"}],"author":"thecodest","twitter_card":"summary_large_image","twitter_misc":{"Written by":"thecodest","Est. reading time":"4 min\u016btes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/thecodest.co\/blog\/active-record-query-interface\/#article","isPartOf":{"@id":"https:\/\/thecodest.co\/blog\/active-record-query-interface\/"},"author":{"name":"thecodest","@id":"https:\/\/thecodest.co\/#\/schema\/person\/7e3fe41dfa4f4e41a7baad4c6e0d4f76"},"headline":"Active Record Query Interface","datePublished":"2019-04-15T08:52:00+00:00","dateModified":"2026-04-24T11:39:17+00:00","mainEntityOfPage":{"@id":"https:\/\/thecodest.co\/blog\/active-record-query-interface\/"},"wordCount":740,"commentCount":0,"publisher":{"@id":"https:\/\/thecodest.co\/#organization"},"image":{"@id":"https:\/\/thecodest.co\/blog\/active-record-query-interface\/#primaryimage"},"thumbnailUrl":"https:\/\/thecodest.co\/app\/uploads\/2024\/05\/cover-image-12.jpg","articleSection":["Software Development"],"inLanguage":"lv-LV","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/thecodest.co\/blog\/active-record-query-interface\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/thecodest.co\/blog\/active-record-query-interface\/","url":"https:\/\/thecodest.co\/blog\/active-record-query-interface\/","name":"Akt\u012bv\u0101 ieraksta vaic\u0101juma saskarne - The Codest","isPartOf":{"@id":"https:\/\/thecodest.co\/#website"},"primaryImageOfPage":{"@id":"https:\/\/thecodest.co\/blog\/active-record-query-interface\/#primaryimage"},"image":{"@id":"https:\/\/thecodest.co\/blog\/active-record-query-interface\/#primaryimage"},"thumbnailUrl":"https:\/\/thecodest.co\/app\/uploads\/2024\/05\/cover-image-12.jpg","datePublished":"2019-04-15T08:52:00+00:00","dateModified":"2026-04-24T11:39:17+00:00","breadcrumb":{"@id":"https:\/\/thecodest.co\/blog\/active-record-query-interface\/#breadcrumb"},"inLanguage":"lv-LV","potentialAction":[{"@type":"ReadAction","target":["https:\/\/thecodest.co\/blog\/active-record-query-interface\/"]}]},{"@type":"ImageObject","inLanguage":"lv-LV","@id":"https:\/\/thecodest.co\/blog\/active-record-query-interface\/#primaryimage","url":"https:\/\/thecodest.co\/app\/uploads\/2024\/05\/cover-image-12.jpg","contentUrl":"https:\/\/thecodest.co\/app\/uploads\/2024\/05\/cover-image-12.jpg","width":1200,"height":600},{"@type":"BreadcrumbList","@id":"https:\/\/thecodest.co\/blog\/active-record-query-interface\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/thecodest.co\/"},{"@type":"ListItem","position":2,"name":"Active Record Query Interface"}]},{"@type":"WebSite","@id":"https:\/\/thecodest.co\/#website","url":"https:\/\/thecodest.co\/","name":"The Codest","description":"","publisher":{"@id":"https:\/\/thecodest.co\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/thecodest.co\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"lv-LV"},{"@type":"Organization","@id":"https:\/\/thecodest.co\/#organization","name":"The Codest","url":"https:\/\/thecodest.co\/","logo":{"@type":"ImageObject","inLanguage":"lv-LV","@id":"https:\/\/thecodest.co\/#\/schema\/logo\/image\/","url":"https:\/\/thecodest.co\/app\/uploads\/2024\/03\/thecodest-logo.svg","contentUrl":"https:\/\/thecodest.co\/app\/uploads\/2024\/03\/thecodest-logo.svg","width":144,"height":36,"caption":"The Codest"},"image":{"@id":"https:\/\/thecodest.co\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/pl.linkedin.com\/company\/codest","https:\/\/clutch.co\/profile\/codest"]},{"@type":"Person","@id":"https:\/\/thecodest.co\/#\/schema\/person\/7e3fe41dfa4f4e41a7baad4c6e0d4f76","name":"thecodest","image":{"@type":"ImageObject","inLanguage":"lv-LV","@id":"https:\/\/secure.gravatar.com\/avatar\/5dbfe6a1e8c86e432e8812759e34e6fe82ebac75119ae3237a6c1311fa19caf4?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/5dbfe6a1e8c86e432e8812759e34e6fe82ebac75119ae3237a6c1311fa19caf4?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/5dbfe6a1e8c86e432e8812759e34e6fe82ebac75119ae3237a6c1311fa19caf4?s=96&d=mm&r=g","caption":"thecodest"},"url":"https:\/\/thecodest.co\/lv\/author\/thecodest\/"}]}},"_links":{"self":[{"href":"https:\/\/thecodest.co\/lv\/wp-json\/wp\/v2\/posts\/3024","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thecodest.co\/lv\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thecodest.co\/lv\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thecodest.co\/lv\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/thecodest.co\/lv\/wp-json\/wp\/v2\/comments?post=3024"}],"version-history":[{"count":9,"href":"https:\/\/thecodest.co\/lv\/wp-json\/wp\/v2\/posts\/3024\/revisions"}],"predecessor-version":[{"id":7711,"href":"https:\/\/thecodest.co\/lv\/wp-json\/wp\/v2\/posts\/3024\/revisions\/7711"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/thecodest.co\/lv\/wp-json\/wp\/v2\/media\/3025"}],"wp:attachment":[{"href":"https:\/\/thecodest.co\/lv\/wp-json\/wp\/v2\/media?parent=3024"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thecodest.co\/lv\/wp-json\/wp\/v2\/categories?post=3024"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thecodest.co\/lv\/wp-json\/wp\/v2\/tags?post=3024"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}