datamapper / dm-adjust Goto Github PK
View Code? Open in Web Editor NEWDataMapper plugin providing methods to increment and decrement properties
Home Page: http://datamapper.org/
License: MIT License
DataMapper plugin providing methods to increment and decrement properties
Home Page: http://datamapper.org/
License: MIT License
Current implementation (master)
def adjust(attributes = {}, reload = false)
collection_for_self.adjust(*args)
end
Should be?
def adjust(*args)
collection_for_self.adjust(*args)
end
See:
https://github.com/datamapper/dm-adjust/blob/master/lib/dm-adjust/resource.rb#L3
This was not found by specs?
I keep getting this error when creating a resource that belongs to another resource.
A: has n, B
B: belongs to A, is a list, and scoped on a_id
I have no idea why this happens
NoMethodError: undefined method `adjust' for #<DataMapper::Adapters::SqliteAdapter:0x000000045d0648>
from /home/qx/.rvm/gems/ruby-1.9.2-p180/gems/dm-adjust-1.2.0.rc2/lib/dm-adjust/repository.rb:4:in `adjust'
from /home/qx/.rvm/gems/ruby-1.9.2-p180/gems/dm-adjust-1.2.0.rc2/lib/dm-adjust/collection.rb:28:in `adjust!'
from /home/qx/.rvm/gems/ruby-1.9.2-p180/gems/dm-is-list-1.2.0.rc2/lib/dm-is-list/is/list.rb:601:in `move_without_saving'
from /home/qx/.rvm/gems/ruby-1.9.2-p180/gems/dm-is-list-1.2.0.rc2/lib/dm-is-list/is/list.rb:265:in `block in is_list'
from /home/qx/.rvm/gems/ruby-1.9.2-p180/gems/dm-core-1.2.0.rc2/lib/dm-core/model/hook.rb:77:in `instance_eval'
from /home/qx/.rvm/gems/ruby-1.9.2-p180/gems/dm-core-1.2.0.rc2/lib/dm-core/model/hook.rb:77:in `call'
from /home/qx/.rvm/gems/ruby-1.9.2-p180/gems/dm-core-1.2.0.rc2/lib/dm-core/resource.rb:1144:in `block in execute_hooks_for'
from /home/qx/.rvm/gems/ruby-1.9.2-p180/gems/dm-core-1.2.0.rc2/lib/dm-core/resource.rb:1144:in `each'
from /home/qx/.rvm/gems/ruby-1.9.2-p180/gems/dm-core-1.2.0.rc2/lib/dm-core/resource.rb:1144:in `execute_hooks_for'
from /home/qx/.rvm/gems/ruby-1.9.2-p180/gems/dm-core-1.2.0.rc2/lib/dm-core/resource.rb:688:in `before_create_hook'
from /home/qx/.rvm/gems/ruby-1.9.2-p180/gems/dm-core-1.2.0.rc2/lib/dm-core/resource.rb:969:in `block in create_with_hooks'
from /home/qx/.rvm/gems/ruby-1.9.2-p180/gems/dm-core-1.2.0.rc2/lib/dm-core/resource.rb:967:in `catch'
from /home/qx/.rvm/gems/ruby-1.9.2-p180/gems/dm-core-1.2.0.rc2/lib/dm-core/resource.rb:967:in `create_with_hooks'
from /home/qx/.rvm/gems/ruby-1.9.2-p180/gems/dm-core-1.2.0.rc2/lib/dm-core/resource.rb:1021:in `save_self'
from /home/qx/.rvm/gems/ruby-1.9.2-p180/gems/dm-validations-1.2.0.rc2/lib/dm-validations.rb:54:in `save_self'
from /home/qx/.rvm/gems/ruby-1.9.2-p180/gems/dm-core-1.2.0.rc2/lib/dm-core/resource.rb:1006:in `block in _save'
... 2 levels...
from /home/qx/.rvm/gems/ruby-1.9.2-p180/gems/dm-core-1.2.0.rc2/lib/dm-core/resource.rb:405:in `save'
from /home/qx/.rvm/gems/ruby-1.9.2-p180/gems/dm-validations-1.2.0.rc2/lib/dm-validations.rb:40:in `block in save'
from /home/qx/.rvm/gems/ruby-1.9.2-p180/gems/dm-validations-1.2.0.rc2/lib/dm-validations/context.rb:16:in `in_context'
from /home/qx/.rvm/gems/ruby-1.9.2-p180/gems/dm-validations-1.2.0.rc2/lib/dm-validations.rb:40:in `save'
from /home/qx/.rvm/gems/ruby-1.9.2-p180/gems/dm-validations-1.2.0.rc2/lib/dm-validations.rb:130:in `create'
from /home/qx/.rvm/gems/ruby-1.9.2-p180/gems/dm-core-1.2.0.rc2/lib/dm-core/collection.rb:1211:in `block in _create'
from /home/qx/.rvm/gems/ruby-1.9.2-p180/gems/dm-core-1.2.0.rc2/lib/dm-core/repository.rb:114:in `scope'
from /home/qx/.rvm/gems/ruby-1.9.2-p180/gems/dm-core-1.2.0.rc2/lib/dm-core/collection.rb:1211:in `_create'
from /home/qx/.rvm/gems/ruby-1.9.2-p180/gems/dm-core-1.2.0.rc2/lib/dm-core/associations/one_to_many.rb:281:in `_create'
from /home/qx/.rvm/gems/ruby-1.9.2-p180/gems/dm-core-1.2.0.rc2/lib/dm-core/collection.rb:793:in `create'
from (irb):6
from /home/qx/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.1.0/lib/rails/commands/console.rb:45:in `start'
from /home/qx/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.1.0/lib/rails/commands/console.rb:8:in `start'
from /home/qx/.rvm/gems/ruby-1.9.2-p180/gems/railties-3.1.0/lib/rails/commands.rb:40:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'ruby-1.9.2-p180
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.