Skip to content
This repository was archived by the owner on Nov 30, 2018. It is now read-only.

Commit 6f671a7

Browse files
committed
Fixed specs to run on latest active admin code
1 parent 5c914d0 commit 6f671a7

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

lib/active_admin/globalize/attributes_table_extension.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ def translated_row(*args, &block)
7474

7575
# @return [Boolean] true iff the field is translatable
7676
def translatable?(field)
77-
@record.class.translates? &&
78-
@record.class.translated_attribute_names.include?(field.to_sym)
77+
@resource_class.translates? &&
78+
@resource_class.translated_attribute_names.include?(field.to_sym)
7979
end
8080

8181
# Build a tag for each field translation with appropriate css classes to make javascript working
@@ -131,7 +131,7 @@ def inline_locale_selectors
131131
end
132132

133133
def available_translations
134-
@record_translations ||= @record.translations.order(:locale)
134+
@record_translations ||= @collection.first.translations.order(:locale)
135135
end
136136

137137
end

spec/dummy/app/admin/articles.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
ActiveAdmin.register Article do
22

3+
permit_params :title, :body
4+
35
index do
46
id_column
57
column :title

0 commit comments

Comments
 (0)