{"id":937,"date":"2014-02-19T22:44:43","date_gmt":"2014-02-19T17:14:43","guid":{"rendered":"http:\/\/www.allerin.com\/blog\/?p=937"},"modified":"2016-05-12T14:45:32","modified_gmt":"2016-05-12T09:15:32","slug":"common-mistakes-in-ror","status":"publish","type":"post","link":"https:\/\/www.allerin.com\/blog\/common-mistakes-in-ror\/","title":{"rendered":"Common mistakes in RoR"},"content":{"rendered":"<p><strong>Database column Indexing<\/strong><br \/>\nAt the beginning of programming , mostly during writing migrations, we forget to add indexes , which may or may not have any effect in initial stages of application, but will have drastic delay in fetching records from the database as the table size increases.<\/p>\n<p><strong>Using delete_all instead of destroy_all<\/strong><br \/>\nActiveRecord::Base::delete_all or ActiveRecord::Base#delete method deletes the record(s) from the database without firing any callback. So, This method must be used sensibly.<br \/>\nWhere as ActiveRecord::Base::destroy_all or ActiveRecord::Base#destroy executes before_destroy and after_destroy callbacks.<\/p>\n<p><strong>ActiveRecord transaction for saving multiple object<\/strong><br \/>\nWhenever saving multiple objects in a single request, always use ActiveRecord::Base::transaction method to support atomicity. So, if any record has not saved the entire transaction, will get rolled back and nothing will be saved into the database.<br \/>\nAlways add indexes to the column being used for searching records.<br \/>\nExample:<\/p>\n<pre>ActiveRecord::Base.transaction do\r\n  @tasks.each do |task|\r\n    task.save!\r\n  end\r\nend<\/pre>\n<p><strong>Set the primary key explicitly for database views<\/strong><br \/>\nSometimes we need to make use of database views for complex data joined from different tables, to reduce the overheads of fetching data in a single query and also to support the searching and sorting based on the columns of joined tables.<\/p>\n<p>Always set the primary key explicitly in the respective model, this will provide the flexibility to define association with other models.<\/p>\n<p>Example:<\/p>\n<pre>Class UserDetailsView &lt; ActiveRecord::Base\r\n  self.table_name = :user_details # user_details is a view in database\r\n  self.primary_key = :id # view_contains id from the joind user table and can be used as primary key for this model\r\nend<\/pre>\n<p><strong>Using IN sub-queries<\/strong><br \/>\nRelational Database supports different types of sub-queries. Unfortunately, one of them is a performance disaster.<\/p>\n<p>IN and NOT IN sub-queries.<br \/>\nStatic array in these queries are fine, but when used sub-query inside, it reduces the performance and also there are limitation on the number of elements in these queries depending on different databases.<\/p>\n<p>Do Not use queries like IN or NOT IN<\/p>\n<p>These queries must be written using EXISTS or NOT EXISTS predicates to avoid serious performance issues.<\/p>\n<p>Note: Oracle optimizes IN fairly well same as EXITS, So both can be used. But not the same case with NOT IN vs NOT EXISTS. Better to use NOT EXISTS even on Oracle instead of NOT IN predicate.<\/p>\n<p><strong>Storing Session in database<\/strong><br \/>\nIt is very easy to store session data in relational databases, but it is the most expensive thing.<br \/>\nSession data are stored and retrieved more frequently and can create scenario when the database can go unresponsive for the more important work to be done.<br \/>\nIf there is a need of database for string session data, then use &#8216;Memcache&#8217; or &#8216;Redis&#8217;.<\/p>\n<p><strong>Make use of Ranges instead of comparisons for numbers<\/strong><br \/>\nNo more if x &gt; 1000 &amp;&amp; x &lt; 2000 nonsense. Instead:<\/p>\n<pre>  year = 1972\r\n  case year\r\n    when 1970..1979: \"Seventies\"\r\n    when 1980..1989: \"Eighties\"\r\n    when 1990..1999: \"Nineties\"\r\n  end<\/pre>\n<p><strong>Use find_each<\/strong><br \/>\nDo not use each method for iterating large set of records(ActiveRecord::Relation). It will fetch all the record in a single query from the database and will dump into the memory, causing<br \/>\nperformance degradation if the there is not enough memory. So, better make use of find_each method, this method not only etches record in batches from the database but yields those once at a time too. Once the current batch is processed another batch will be fetched from the database. So no need to have all the records at once in the memory.<br \/>\nExample:<\/p>\n<pre>Book.where(:published =&gt; true).find_each do |book|\r\n  puts \"Do something here!\"\r\nend<\/pre>\n<p><strong>Use pluck instead of map<\/strong><br \/>\nWe often need to find a single column from the database, So many of us make use of map method on ActiveRecord::Relation.<br \/>\nLike:<\/p>\n<pre>User.active.select(:name).map(&amp;:name)<\/pre>\n<p>Or, even worse:<\/p>\n<pre>User.active.map(&amp;:name)<\/pre>\n<p>Instead use pluck method:<br \/>\nExample:<\/p>\n<pre>User.active.pluck(:name)<\/pre>\n<p><strong>Rescue to the rescue<\/strong><br \/>\nUse rescue for one liner statements which may throw error instead of condition:<\/p>\n<pre>hsh = {:age =&gt; 50}\r\nhsh[:name].downcase #=&gt; Error\r\nhsh[:name].try(:downcase) #=&gt; nil<\/pre>\n<p>Or, even worse:<\/p>\n<pre>hsh[:name] ? hsh[:name].downcase : nil #=&gt; nil<\/pre>\n<p>Instead use as below:<\/p>\n<pre>hsh[:name].downcase rescue nil #=&gt; nil<\/pre>\n<p>OR<\/p>\n<pre>hsh[:name].to_s.downcase #=&gt; ''<\/pre>\n<p><strong>Allow both single item and and array to make use of the same loop without condition<\/strong><br \/>\nI have observed that few folks write something like this<\/p>\n<pre>(items.is_a?(Array) ? Items : [items]).each do |item|\r\n  #------------------\r\nend<\/pre>\n<p>Instead use following:<\/p>\n<pre>[*items].each do |item|\r\n  #------------------\r\nend<\/pre>\n<p>Above code will take care of items containing either a single object or array.<\/p>\n<p><strong>Try to reduce redundancy using Ruby&#8217;s logic<\/strong><br \/>\nmethod for checking odd number:<\/p>\n<pre>def odd?(x)\r\n  x % 2 == 0 ? false : true\r\nend<\/pre>\n<p>Instead make use of Ruby logics and simply it somewhat more.<\/p>\n<pre>def odd?(x)\r\n  x % 2 != 0\r\nend<\/pre>\n<p><strong>SQL Injection<\/strong><\/p>\n<p>Never interpolate the input from the outside world into ActiveRecord query directly.<\/p>\n<pre>query = \"SELECT * FROM users WHERE name = '#{name}' AND password = '#{password'} LIMIT 1\"\r\nresults = User.connection.execute(query)<\/pre>\n<p>Above query will behave unexpected whenever a sql injection string is passed and name nad password:<br \/>\nExample:<\/p>\n<pre>name: ' OR 'a' = 'a\r\npassword: ' OR 'a' = 'a<\/pre>\n<p>above input will generate query something like<\/p>\n<pre>SELECT * FROM users WHERE name = '' OR 'a' = 'a' AND password = '' OR 'a' = 'a' LIMIT 1<\/pre>\n<p>And above query will always return a user. Instead make use of &#8216;where&#8217; or &#8216;find_by&#8217; methods these will automatically escape the commas(&#8216;\/\u201d) in the input value and will not allow query to return true and will check the record in database exactly what it had been passed as name and password.<\/p>\n<p><strong>ActiveRecord::Base::exists<\/strong><br \/>\nSometime we just need to check for existence of any record in the database. And I have seen coders are writing something like:<br \/>\nTo check whether published books are present in the database or not:<\/p>\n<pre>books = Book.where(:published =&gt; true)\r\nbooks.count &gt; 0 # will return true if published books exists in datatbase.<\/pre>\n<p>Instead use ActiveRecord::Base::exists method as:<\/p>\n<pre>Book.exists?(:published =&gt; true)<\/pre>\n<p><strong>N+1 queries<\/strong><br \/>\nSo, Basically it happens when we load a bunch of objects from the database, and then for each one of those objects we make 1 or more database query.<br \/>\nExample:<\/p>\n<pre>class Customer  { where(active: true) }\r\nend<\/pre>\n<pre>class Address &lt; ActiveRecor...\r\n  belongs_to :customer\r\nend<\/pre>\n<pre>@customers = Customer.active<\/pre>\n<pre>   # this is fine the customer object is already in memory\r\n   # this one fires one query to the database for finding Address record for each custome<\/pre>\n<p>Suppose we have 100 active customers then total database queries will be 101.<br \/>\n1 query for finding all the active customers and other 100 queries for finding an address for each.<br \/>\nInstead try eager_loading and just fire 2 queries for all.<\/p>\n<pre>@customers = Customer.active.includes(:address)<\/pre>\n<p>The above query will fire 1 query for finding all the customers and other query for finding all the address associated to the clients fetched in the first query.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Few common mistakes, must be taken care of while developing RoR applications.<\/p>\n","protected":false},"author":13,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","_links_to":"","_links_to_target":""},"categories":[4,3],"tags":[10,20],"class_list":["post-937","post","type-post","status-publish","format-standard","hentry","category-my-voice","category-technology","tag-rails","tag-ruby-on-rails"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v25.5 (Yoast SEO v27.6) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Common mistakes in Ruby and Ruby on Rails<\/title>\n<meta name=\"description\" content=\"We talk about few mistakes what most of programmers commit during their coding assignments in ruby on rails, specially in development environment.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.allerin.com\/blog\/common-mistakes-in-ror\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Common mistakes in RoR\" \/>\n<meta property=\"og:description\" content=\"Few common mistakes, must be taken care of while developing RoR applications.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.allerin.com\/blog\/common-mistakes-in-ror\/\" \/>\n<meta property=\"og:site_name\" content=\"Artificial Intelligence, ROBOTICS, AUTOMATION\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/allerintech\" \/>\n<meta property=\"article:published_time\" content=\"2014-02-19T17:14:43+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2016-05-12T09:15:32+00:00\" \/>\n<meta name=\"author\" content=\"Nitesh Varma\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Nitesh Varma\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.allerin.com\\\/blog\\\/common-mistakes-in-ror\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.allerin.com\\\/blog\\\/common-mistakes-in-ror\\\/\"},\"author\":{\"name\":\"Nitesh Varma\",\"@id\":\"https:\\\/\\\/www.allerin.com\\\/blog\\\/#\\\/schema\\\/person\\\/62051995e859f22af8935f2c15a7f00d\"},\"headline\":\"Common mistakes in RoR\",\"datePublished\":\"2014-02-19T17:14:43+00:00\",\"dateModified\":\"2016-05-12T09:15:32+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.allerin.com\\\/blog\\\/common-mistakes-in-ror\\\/\"},\"wordCount\":893,\"commentCount\":6,\"publisher\":{\"@id\":\"https:\\\/\\\/www.allerin.com\\\/blog\\\/#organization\"},\"keywords\":[\"rails\",\"Ruby on Rails\"],\"articleSection\":[\"My Voice\",\"Technology\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.allerin.com\\\/blog\\\/common-mistakes-in-ror\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.allerin.com\\\/blog\\\/common-mistakes-in-ror\\\/\",\"url\":\"https:\\\/\\\/www.allerin.com\\\/blog\\\/common-mistakes-in-ror\\\/\",\"name\":\"Common mistakes in Ruby and Ruby on Rails\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.allerin.com\\\/blog\\\/#website\"},\"datePublished\":\"2014-02-19T17:14:43+00:00\",\"dateModified\":\"2016-05-12T09:15:32+00:00\",\"description\":\"We talk about few mistakes what most of programmers commit during their coding assignments in ruby on rails, specially in development environment.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.allerin.com\\\/blog\\\/common-mistakes-in-ror\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.allerin.com\\\/blog\\\/common-mistakes-in-ror\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.allerin.com\\\/blog\\\/common-mistakes-in-ror\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.allerin.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Common mistakes in RoR\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.allerin.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.allerin.com\\\/blog\\\/\",\"name\":\"Artificial Intelligence, ROBOTICS, AUTOMATION\",\"description\":\"Empowering Futures: Innovating with AI and Machine Learning\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.allerin.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.allerin.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.allerin.com\\\/blog\\\/#organization\",\"name\":\"Allerin\",\"url\":\"https:\\\/\\\/www.allerin.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.allerin.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.allerin.com\\\/blog\\\/wp-content\\\/uploads\\\/2016\\\/06\\\/logo-fire.png\",\"contentUrl\":\"https:\\\/\\\/www.allerin.com\\\/blog\\\/wp-content\\\/uploads\\\/2016\\\/06\\\/logo-fire.png\",\"width\":1000,\"height\":1000,\"caption\":\"Allerin\"},\"image\":{\"@id\":\"https:\\\/\\\/www.allerin.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/allerintech\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/allerintech\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.allerin.com\\\/blog\\\/#\\\/schema\\\/person\\\/62051995e859f22af8935f2c15a7f00d\",\"name\":\"Nitesh Varma\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/b21e15576ea716b8c732b52f63ca14cccbe5d0d086a907d9017b5146f5c7237a?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/b21e15576ea716b8c732b52f63ca14cccbe5d0d086a907d9017b5146f5c7237a?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/b21e15576ea716b8c732b52f63ca14cccbe5d0d086a907d9017b5146f5c7237a?s=96&d=mm&r=g\",\"caption\":\"Nitesh Varma\"},\"sameAs\":[\"http:\\\/\\\/www.allerin.com\"],\"url\":\"https:\\\/\\\/www.allerin.com\\\/blog\\\/author\\\/niteshv\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Common mistakes in Ruby and Ruby on Rails","description":"We talk about few mistakes what most of programmers commit during their coding assignments in ruby on rails, specially in development environment.","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:\/\/www.allerin.com\/blog\/common-mistakes-in-ror\/","og_locale":"en_US","og_type":"article","og_title":"Common mistakes in RoR","og_description":"Few common mistakes, must be taken care of while developing RoR applications.","og_url":"https:\/\/www.allerin.com\/blog\/common-mistakes-in-ror\/","og_site_name":"Artificial Intelligence, ROBOTICS, AUTOMATION","article_publisher":"https:\/\/www.facebook.com\/allerintech","article_published_time":"2014-02-19T17:14:43+00:00","article_modified_time":"2016-05-12T09:15:32+00:00","author":"Nitesh Varma","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Nitesh Varma","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.allerin.com\/blog\/common-mistakes-in-ror\/#article","isPartOf":{"@id":"https:\/\/www.allerin.com\/blog\/common-mistakes-in-ror\/"},"author":{"name":"Nitesh Varma","@id":"https:\/\/www.allerin.com\/blog\/#\/schema\/person\/62051995e859f22af8935f2c15a7f00d"},"headline":"Common mistakes in RoR","datePublished":"2014-02-19T17:14:43+00:00","dateModified":"2016-05-12T09:15:32+00:00","mainEntityOfPage":{"@id":"https:\/\/www.allerin.com\/blog\/common-mistakes-in-ror\/"},"wordCount":893,"commentCount":6,"publisher":{"@id":"https:\/\/www.allerin.com\/blog\/#organization"},"keywords":["rails","Ruby on Rails"],"articleSection":["My Voice","Technology"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.allerin.com\/blog\/common-mistakes-in-ror\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.allerin.com\/blog\/common-mistakes-in-ror\/","url":"https:\/\/www.allerin.com\/blog\/common-mistakes-in-ror\/","name":"Common mistakes in Ruby and Ruby on Rails","isPartOf":{"@id":"https:\/\/www.allerin.com\/blog\/#website"},"datePublished":"2014-02-19T17:14:43+00:00","dateModified":"2016-05-12T09:15:32+00:00","description":"We talk about few mistakes what most of programmers commit during their coding assignments in ruby on rails, specially in development environment.","breadcrumb":{"@id":"https:\/\/www.allerin.com\/blog\/common-mistakes-in-ror\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.allerin.com\/blog\/common-mistakes-in-ror\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.allerin.com\/blog\/common-mistakes-in-ror\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.allerin.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Common mistakes in RoR"}]},{"@type":"WebSite","@id":"https:\/\/www.allerin.com\/blog\/#website","url":"https:\/\/www.allerin.com\/blog\/","name":"Artificial Intelligence, ROBOTICS, AUTOMATION","description":"Empowering Futures: Innovating with AI and Machine Learning","publisher":{"@id":"https:\/\/www.allerin.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.allerin.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.allerin.com\/blog\/#organization","name":"Allerin","url":"https:\/\/www.allerin.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.allerin.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.allerin.com\/blog\/wp-content\/uploads\/2016\/06\/logo-fire.png","contentUrl":"https:\/\/www.allerin.com\/blog\/wp-content\/uploads\/2016\/06\/logo-fire.png","width":1000,"height":1000,"caption":"Allerin"},"image":{"@id":"https:\/\/www.allerin.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/allerintech","https:\/\/www.linkedin.com\/company\/allerintech"]},{"@type":"Person","@id":"https:\/\/www.allerin.com\/blog\/#\/schema\/person\/62051995e859f22af8935f2c15a7f00d","name":"Nitesh Varma","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/b21e15576ea716b8c732b52f63ca14cccbe5d0d086a907d9017b5146f5c7237a?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/b21e15576ea716b8c732b52f63ca14cccbe5d0d086a907d9017b5146f5c7237a?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/b21e15576ea716b8c732b52f63ca14cccbe5d0d086a907d9017b5146f5c7237a?s=96&d=mm&r=g","caption":"Nitesh Varma"},"sameAs":["http:\/\/www.allerin.com"],"url":"https:\/\/www.allerin.com\/blog\/author\/niteshv\/"}]}},"_links":{"self":[{"href":"https:\/\/www.allerin.com\/blog\/wp-json\/wp\/v2\/posts\/937","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.allerin.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.allerin.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.allerin.com\/blog\/wp-json\/wp\/v2\/users\/13"}],"replies":[{"embeddable":true,"href":"https:\/\/www.allerin.com\/blog\/wp-json\/wp\/v2\/comments?post=937"}],"version-history":[{"count":10,"href":"https:\/\/www.allerin.com\/blog\/wp-json\/wp\/v2\/posts\/937\/revisions"}],"predecessor-version":[{"id":1385,"href":"https:\/\/www.allerin.com\/blog\/wp-json\/wp\/v2\/posts\/937\/revisions\/1385"}],"wp:attachment":[{"href":"https:\/\/www.allerin.com\/blog\/wp-json\/wp\/v2\/media?parent=937"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.allerin.com\/blog\/wp-json\/wp\/v2\/categories?post=937"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.allerin.com\/blog\/wp-json\/wp\/v2\/tags?post=937"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}