Skip to content

Commit

Permalink
update mobility-ransack to 1.2.2 (ransack 4.1.1)
Browse files Browse the repository at this point in the history
  • Loading branch information
madhums committed Jan 2, 2024
1 parent ba2b92a commit 9f94ac5
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ gem "administrate", "~> 0.18.0"

# Translatable content
gem "mobility", "~> 1.2"
gem "mobility-ransack", "~> 1.2"
gem "mobility-ransack", "~> 1.2.2"

# Soft deletions
gem "discard", "~> 1.2"
Expand Down
12 changes: 6 additions & 6 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,9 @@ GEM
mobility (1.2.9)
i18n (>= 0.6.10, < 2)
request_store (~> 1.0)
mobility-ransack (1.2.1)
mobility-ransack (1.2.2)
mobility (>= 1.0.1, < 2.0)
ransack (>= 1.8.0, < 3.2)
ransack (>= 1.8.0, < 5.0)
msgpack (1.6.0)
nenv (0.3.0)
net-imap (0.3.1)
Expand Down Expand Up @@ -292,9 +292,9 @@ GEM
zeitwerk (~> 2.5)
rainbow (3.1.1)
rake (13.0.6)
ransack (3.1.0)
activerecord (>= 6.0.4)
activesupport (>= 6.0.4)
ransack (4.1.1)
activerecord (>= 6.1.5)
activesupport (>= 6.1.5)
i18n
rb-fsevent (0.11.2)
rb-inotify (0.10.1)
Expand Down Expand Up @@ -451,7 +451,7 @@ DEPENDENCIES
jsbundling-rails (~> 1.0)
kaminari (~> 1.2)
mobility (~> 1.2)
mobility-ransack (~> 1.2)
mobility-ransack (~> 1.2.2)
pg (~> 1.1)
puma (~> 5.6)
pundit (~> 2.2)
Expand Down
8 changes: 8 additions & 0 deletions app/models/story.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@ class Story < ApplicationRecord
discussions.undiscard_all
end

def self.ransackable_attributes(auth_object = nil)
%w[title, description, outcomes, source, country]
end

def self.ransackable_associations(auth_object = nil)
%w[story_updates]
end

# https://github.com/countries/country_select#getting-the-country-name-from-the-countries-gem
# Assuming country_select is used with User attribute `country`
# This will attempt to translate the country name and use the default
Expand Down
4 changes: 4 additions & 0 deletions app/models/story_update.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,8 @@ class StoryUpdate < ApplicationRecord

validates :title, :description, presence: true
translates :title, :description

def self.ransackable_attributes(auth_object = nil)
%w[title description]
end
end

0 comments on commit 9f94ac5

Please sign in to comment.