Skip to content

Commit

Permalink
Use query plugin for hstore querying
Browse files Browse the repository at this point in the history
  • Loading branch information
shioyama committed Apr 29, 2018
1 parent a0d9c7a commit 76c905f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/mobility/backends/active_record/hstore.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ def write(locale, value, options = {})
super(locale, value && value.to_s, options)
end
# @!endgroup

def self.build_node(attr, locale, model_class:, column_affix:, **)
column_name = column_affix % attr
::Arel::Nodes::InfixOperation.new(:'->', model_class.arel_table[column_name], build_quoted(locale))
end
end
end
end
Expand Down

0 comments on commit 76c905f

Please sign in to comment.