Questions tagged [acts-as-list]
ActsAsList is a Rails plugin that provides list abilities to an ActiveRecord model
acts-as-list
74
questions
1
vote
1
answer
77
views
Stack level too deep when calling remove_from_list from acts_as_list gem
I'm running a test that did not fail before upgrading to rails 5.0, but now I am getting stack level too deep, the test is as follows:
describe "item hierarchy" do
before(:each) do
@...
0
votes
1
answer
453
views
Acts as paranoid gem interferes with acts as list
I use both acts_as_paranoid and acts_as_list for the same model, CheckIn. I have the gem setup as follows:
class CheckIn < ActiveRecord::Base
acts_as_paranoid
belongs_to :client
...
0
votes
1
answer
245
views
How to use remove_from_list method of ActiveRecord with scope as public in the model?
Lets say my model is C . Obj - @c
C has acts_as_list gem defined as
acts_as_list scope: '...'
and scope as :
scope :public -> {where (some_condition)}
When writing rspec for @c.remove_from_list , ...
0
votes
1
answer
135
views
Acts as list with a subgroup
I'm using the popular gem, acts_as_list and I am having issue with getting the scope to work. Basically there're three models, a group, a subgroup, and a thing. A group has many subgroups and a ...
1
vote
2
answers
265
views
acts_as_list upper_limit on position
I am using acts_as_list on my model.I have a position column on that model for which I don't wan't the model object to be saved to the database if the position is more than my upper-limit.(I tried ...
1
vote
1
answer
205
views
added `acts_as_list` to gemfile, rails gives error :`bundler: failed to load command: rails` when running rails s
I added the gem acts_as_listto my gemfile. Now when I run bundle exec rails s the server crashes and gives the error : bundler: failed to load command: rails (/Users/dadi/.rbenv/versions/2.3.1/bin/...
0
votes
1
answer
463
views
acts_as_list with paranoia gem
I have two models. The first ModelA is the parent of ModelB. ie ModelA has_many ModelB. [When modelA is destroyed, all its dependent ModelB's also gets destroyed due to dependent destroy
Now I have ...
0
votes
1
answer
881
views
Using acts_as_list, set scope to string column
Using acts_as_list, I'm trying to set the scope to the where column.
acts_as_list scope: :where
where is the name of a string column in the model.
But when I'm getting this error:
undefined ...
0
votes
1
answer
578
views
multi position column with acts_as_list
How to use multi position columns with acts_as_list gem ?
for sample :
rails g migration AddPositionToTodoList position:integer position2:integer position3:integer
controller:
todo_list = TodoList....
2
votes
0
answers
199
views
'last' method not returning last item in array in RSpec test - Rails4 Ruby 2.1.2
Was working on an RSpec test that copies @protocol to @dest and saw this:
[26] pry(#<RSpec::ExampleGroups::ProtocolsController::ProtocolCopy>)> @protocol.step_items.count
=> 3
[27] pry(#&...
1
vote
0
answers
153
views
Sort collection after associated resource's acts_as_tree/acts_as_list order
I have a SuccessCriterion model that implements both acts_as_tree and acts_as_list so it can be arranged as sorted tree hierarchy. Every success criterion can has many Boilerplate objects.
class ...
0
votes
1
answer
276
views
Ruby gem dependency loading
I'm putting some shared models for a rails app inside it's own gem. It's just models, so I'm not using an engine. Getting it set up seemed to work fine until I added the "acts_as_list" gem.
# gem - ...
0
votes
1
answer
61
views
Maintain order of saved attributes list for model
I have two models with a has_many to has_many relationship through a join table.
class Article < ActiveRecord::Base
has_many :authorings, -> { order(:position) }, :dependent => :destroy
...
2
votes
1
answer
890
views
Rails: How can I incrementally add items to a sorted list in one view
I am trying to create a set list app for musicians. Users can upload their repertoire of songs & pick songs from a list of those songs to populate a set list for a specific performance.
See ...
0
votes
1
answer
754
views
Rails: Ancestry + Acts_as_List Gems Not Working as Expected When Changing Parent Object
I have a Ruby on Rails 3 app which uses the ancestry gem to provide a hierarchical tree structure for a model in combination with the acts_as_list gem to provide explicit positioning within each level ...