lib/mobility/backends/sequel/container/query_methods.rb in mobility-0.4.1 vs lib/mobility/backends/sequel/container/query_methods.rb in mobility-0.4.2
- old
+ new
@@ -9,19 +9,11 @@
include Sequel::PgQueryMethods
attr_reader :column_name
def initialize(attributes, options)
super
- column_name = @column_name = options[:column_name]
-
+ @column_name = options[:column_name]
define_query_methods
-
- attributes.each do |attribute|
- define_method :"first_by_#{attribute}" do |value|
- where(::Sequel.pg_jsonb_op(column_name)[Mobility.locale.to_s].contains({ attribute => value })).
- select_all(model.table_name).first
- end
- end
end
private
def matches(key, value, locale)