Skip to content

Commit

Permalink
Remove unnecessary translations_conditions method
Browse files Browse the repository at this point in the history
  • Loading branch information
bricesanchez committed Apr 6, 2018
1 parent 0f831f6 commit fa12fe7
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions pages/lib/refinery/pages/finder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,10 @@ def find

def with_mobility
mobility_conditions = {:locale => ::Mobility.locale.to_s}.merge(conditions)
translations_conditions = translations_conditions(mobility_conditions)

# A join implies readonly which we don't really want.
Page.i18n.where(mobility_conditions).
joins(:translations).
where(translations_conditions).
readonly(false)
end

Expand All @@ -46,17 +44,6 @@ def with_mobility
def translated_attributes
Page.translated_attribute_names.map(&:to_s) | %w(locale)
end

def translations_conditions(original_conditions)
translations_conditions = {}
original_conditions.keys.each do |key|
if translated_attributes.include? key.to_s
translations_conditions["#{Page::Translation.table_name}.#{key}"] = original_conditions.delete(key)
end
end
translations_conditions
end

end

class FinderByTitle < Finder
Expand Down

0 comments on commit fa12fe7

Please sign in to comment.