File tree Expand file tree Collapse file tree 5 files changed +9
-9
lines changed Expand file tree Collapse file tree 5 files changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -17,8 +17,8 @@ class FeyAPI < Base
1717 result [ :h ] [ 0 ] [ :name ] = term . name if term . lower_name != term . name
1818 term . descriptions . each do |description |
1919 description_hash = { f : description . content }
20- description_hash [ :e ] = description . examples . map ( & :content ) if description . examples . present?
21- description_hash [ :s ] = description . synonyms . alts . map ( & :content ) if description . synonyms . alts . present?
20+ description_hash [ :e ] = description . examples . pluck ( :content ) if description . examples . present?
21+ description_hash [ :s ] = description . synonyms . alts . pluck ( :content ) if description . synonyms . alts . present?
2222 result [ :h ] [ 0 ] [ :d ] << description_hash
2323 end
2424
Original file line number Diff line number Diff line change @@ -17,8 +17,8 @@ class PoinsotAPI < Base
1717 result [ :h ] [ 0 ] [ :name ] = term . name if term . lower_name != term . name
1818 term . descriptions . each do |description |
1919 description_hash = { f : description . content }
20- description_hash [ :e ] = description . examples . map ( & :content ) if description . examples . present?
21- description_hash [ :s ] = description . synonyms . alts . map ( & :content ) if description . synonyms . alts . present?
20+ description_hash [ :e ] = description . examples . pluck ( :content ) if description . examples . present?
21+ description_hash [ :s ] = description . synonyms . alts . pluck ( :content ) if description . synonyms . alts . present?
2222 description_hash [ :type ] = description . description_type if description . description_type . present?
2323 result [ :h ] [ 0 ] [ :d ] << description_hash
2424 end
Original file line number Diff line number Diff line change @@ -18,9 +18,9 @@ class SafoluAPI < Base
1818 result [ :h ] [ 0 ] [ :name ] = term . name if term . lower_name != term . name
1919 term . descriptions . each do |description |
2020 description_hash = { f : description . content }
21- description_hash [ :e ] = description . examples . map ( & :content ) if description . examples . present?
22- description_hash [ :s ] = description . synonyms . alts . map ( & :content ) if description . synonyms . alts . present?
23- description_hash [ :r ] = description . synonyms . refs . map ( & :content ) if description . synonyms . refs . present?
21+ description_hash [ :e ] = description . examples . pluck ( :content ) if description . examples . present?
22+ description_hash [ :s ] = description . synonyms . alts . pluck ( :content ) if description . synonyms . alts . present?
23+ description_hash [ :r ] = description . synonyms . refs . pluck ( :content ) if description . synonyms . refs . present?
2424 result [ :h ] [ 0 ] [ :d ] << description_hash
2525 end
2626
Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ def show
2121 end
2222 id_case_statement . else ( 10000 )
2323
24- @dictionaries = Dictionary . where ( id : @terms . map ( & :dictionary_id ) . uniq ) . order ( id_case_statement )
24+ @dictionaries = Dictionary . where ( id : @terms . pluck ( :dictionary_id ) . uniq ) . order ( id_case_statement )
2525 session [ :last_page ] = request . url
2626 end
2727end
Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ def self.ransackable_attributes(auth_object = nil)
7171
7272 def short_description
7373 Rails . cache . fetch ( "term-#{ name } -#{ Date . today } " , expires_in : 6 . hours ) do
74- term_ids = Term . select ( :id ) . where ( name : name ) . order ( :dictionary_id ) . pluck ( :id )
74+ term_ids = Term . where ( name : name ) . order ( :dictionary_id ) . pluck ( :id )
7575
7676 arel_description = Description . arel_table
7777 case_statement = Arel ::Nodes ::Case . new ( arel_description [ :term_id ] )
You can’t perform that action at this time.
0 commit comments