locomotivecms / custom_fields Goto Github PK
View Code? Open in Web Editor NEWManage custom fields to a mongoid document or a collection
License: MIT License
Manage custom fields to a mongoid document or a collection
License: MIT License
I cannot bundle install locomotivecms anymore with new rubygems version 3.0.1
Bundler could not find compatible versions for gem "rubygems":
In Gemfile:
rubygems (= 3.0.1)
locomotivecms was resolved to 3.4.1, which depends on
custom_fields (~> 2.9.0) was resolved to 2.9.0, which depends on
rubygems (~> 2.4)
When select options are saved on the content-entry and an entry is made. Any changes made to the content-entry-s custom fields select options after that are ignored by the entry.
This is expected for locomotivecms 3.x. We might also want to drop memoized classes.
It happens when you've got 2 fields: belongs_to + many_to_many in a same model.
The problem is that we don't set the inverse_of property of a belongs_to field but we have to in order to avoid that error.
Better explanation here:
https://github.com/mongoid/mongoid/issues/1434
I was wondering if Indexes are created for unique fields to make it so they perform in a efficient manner?
You shouldn't just take and override that method valid_options, it causes disabling new features of mongoid, such as :touch and :dependent options in belongs_to. Maybe it would be better to merge your params to parent method.
Boolean type is checkbox in rc2.0.0.7 how?
Mongodb 2.4 allowed us to have $set, $unset and $rename operations in a same mongodb query. Mongodb does not allow it anymore. Here is the fix.
3c27301
Has_one and belong_to are not the same associations, has_one is needed back.
in order to use queries like described here: http://stackoverflow.com/questions/4705024/mongodb-query-based-on-count-of-embedded-document
the famous tag cloud. If possible, let's use an existing lib.
In the locomotive_editor (1.0.0.rc17) if you push a content_entry with a select_option that is set to localized: true, the CMS reports an error:
Completed 500 Internal Server Error in 8ms
NoMethodError (undefined method `merge!' for BSON::ObjectId('50ec5dcc5f82fd44bd000272'):BSON::ObjectId):
mongoid (2.4.12) lib/mongoid/attributes.rb:107:in `block (2 levels) in write_attribute'
mongoid (2.4.12) lib/mongoid/attributes.rb:102:in `tap'
mongoid (2.4.12) lib/mongoid/attributes.rb:102:in `block in write_attribute'
mongoid (2.4.12) lib/mongoid/threaded/lifecycle.rb:26:in `_assigning'
mongoid (2.4.12) lib/mongoid/attributes.rb:99:in `write_attribute'
(eval):2:in `partner_group_id='
custom_fields (2.0.0.rc13) lib/custom_fields/types/select.rb:167:in `_set_select_option'
custom_fields (2.0.0.rc13) lib/custom_fields/types/select.rb:77:in `block in apply_select_custom_field'
It replace the _id of the parent by the one of the belongs_to object.
Heres the problem.
I have a Creative and a Conversion. A creative has many conversions and a conversion has custom fields.
class Creative
include Mongoid::Document
include Mongoid::Timestamps
include CustomFields::Source
has_many :conversions
custom_fields_for :conversions
end
class Conversion
include Mongoid::Document
include Mongoid::Timestamps
include CustomFields::Target
belongs_to :creative, inverse_of: :conversions
field :ip_address, type: String
field :location, type: String
attr_accessible :ip_address, :location
end
When I create a new conversion using the build method as per the docs it works fine. Once I do Creative.first.conversions.first I get this error. If I do Creative.first.conversions it outputs the conversions as an array or outputs (Object doesn't support #inspect). Please note custom_fields_recipe appears to be nil!
NoMethodError: undefined method []' for nil:NilClass from /Users/Jarrett-Mac-Mini-Home/.rvm/gems/ruby-2.0.0-rc2/gems/custom_fields-2.3.1/lib/custom_fields/target.rb:76:in
klass_with_custom_fields'
from /Users/Jarrett-Mac-Mini-Home/.rvm/gems/ruby-2.0.0-rc2/gems/custom_fields-2.3.1/lib/custom_fields/extensions/mongoid/factory.rb:9:in from_db_with_custom_fields' from /Users/Jarrett-Mac-Mini-Home/.rvm/gems/ruby-2.0.0-rc2/gems/mongoid-3.1.5/lib/mongoid/contextual/eager.rb:151:in
block in with_eager_loading'
from /Users/Jarrett-Mac-Mini-Home/.rvm/gems/ruby-2.0.0-rc2/gems/mongoid-3.1.5/lib/mongoid/contextual/mongo.rb:619:in selecting' from /Users/Jarrett-Mac-Mini-Home/.rvm/gems/ruby-2.0.0-rc2/gems/mongoid-3.1.5/lib/mongoid/contextual/eager.rb:149:in
with_eager_loading'
from /Users/Jarrett-Mac-Mini-Home/.rvm/gems/ruby-2.0.0-rc2/gems/mongoid-3.1.5/lib/mongoid/contextual/mongo.rb:196:in block in first' from /Users/Jarrett-Mac-Mini-Home/.rvm/gems/ruby-2.0.0-rc2/gems/mongoid-3.1.5/lib/mongoid/contextual/mongo.rb:506:in
with_sorting'
from /Users/Jarrett-Mac-Mini-Home/.rvm/gems/ruby-2.0.0-rc2/gems/mongoid-3.1.5/lib/mongoid/contextual/mongo.rb:195:in first' from /Users/Jarrett-Mac-Mini-Home/.rvm/gems/ruby-2.0.0-rc2/gems/mongoid-3.1.5/lib/mongoid/contextual.rb:19:in
first'
from /Users/Jarrett-Mac-Mini-Home/.rvm/gems/ruby-2.0.0-rc2/gems/activesupport-3.2.14/lib/active_support/core_ext/object/try.rb:36:in try' from /Users/Jarrett-Mac-Mini-Home/.rvm/gems/ruby-2.0.0-rc2/gems/mongoid-3.1.5/lib/mongoid/relations/targets/enumerable.rb:462:in
matching_document'
from /Users/Jarrett-Mac-Mini-Home/.rvm/gems/ruby-2.0.0-rc2/gems/mongoid-3.1.5/lib/mongoid/relations/targets/enumerable.rb:220:in first' from /Users/Jarrett-Mac-Mini-Home/.rvm/gems/ruby-2.0.0-rc2/gems/mongoid-3.1.5/lib/mongoid/relations/referenced/many.rb:11:in
first'
from (irb):48
from /Users/Jarrett-Mac-Mini-Home/.rvm/gems/ruby-2.0.0-rc2/gems/railties-3.2.14/lib/rails/commands/console.rb:47:in start' from /Users/Jarrett-Mac-Mini-Home/.rvm/gems/ruby-2.0.0-rc2/gems/railties-3.2.14/lib/rails/commands/console.rb:8:in
start'
... 10 levels...
from /Users/Jarrett-Mac-Mini-Home/.rvm/gems/ruby-2.0.0-rc2/gems/zeus-0.13.3/lib/zeus.rb:62:in go' from /Users/Jarrett-Mac-Mini-Home/.rvm/gems/ruby-2.0.0-rc2/gems/zeus-0.13.3/lib/zeus.rb:78:in
block (3 levels) in go'
from /Users/Jarrett-Mac-Mini-Home/.rvm/gems/ruby-2.0.0-rc2/gems/zeus-0.13.3/lib/zeus.rb:78:in fork' from /Users/Jarrett-Mac-Mini-Home/.rvm/gems/ruby-2.0.0-rc2/gems/zeus-0.13.3/lib/zeus.rb:78:in
block (2 levels) in go'
from /Users/Jarrett-Mac-Mini-Home/.rvm/gems/ruby-2.0.0-rc2/gems/zeus-0.13.3/lib/zeus.rb:73:in each' from /Users/Jarrett-Mac-Mini-Home/.rvm/gems/ruby-2.0.0-rc2/gems/zeus-0.13.3/lib/zeus.rb:73:in
block in go'
from /Users/Jarrett-Mac-Mini-Home/.rvm/gems/ruby-2.0.0-rc2/gems/zeus-0.13.3/lib/zeus.rb:62:in loop' from /Users/Jarrett-Mac-Mini-Home/.rvm/gems/ruby-2.0.0-rc2/gems/zeus-0.13.3/lib/zeus.rb:62:in
go'
from /Users/Jarrett-Mac-Mini-Home/.rvm/gems/ruby-2.0.0-rc2/gems/zeus-0.13.3/lib/zeus.rb:78:in block (3 levels) in go' from /Users/Jarrett-Mac-Mini-Home/.rvm/gems/ruby-2.0.0-rc2/gems/zeus-0.13.3/lib/zeus.rb:78:in
fork'
from /Users/Jarrett-Mac-Mini-Home/.rvm/gems/ruby-2.0.0-rc2/gems/zeus-0.13.3/lib/zeus.rb:78:in block (2 levels) in go' from /Users/Jarrett-Mac-Mini-Home/.rvm/gems/ruby-2.0.0-rc2/gems/zeus-0.13.3/lib/zeus.rb:73:in
each'
from /Users/Jarrett-Mac-Mini-Home/.rvm/gems/ruby-2.0.0-rc2/gems/zeus-0.13.3/lib/zeus.rb:73:in block in go' from /Users/Jarrett-Mac-Mini-Home/.rvm/gems/ruby-2.0.0-rc2/gems/zeus-0.13.3/lib/zeus.rb:62:in
loop'
from /Users/Jarrett-Mac-Mini-Home/.rvm/gems/ruby-2.0.0-rc2/gems/zeus-0.13.3/lib/zeus.rb:62:in `go'
Boolean custom fields have the option of being "required" or not. However, this actually doesn't make any sense. It turns out that if you make the field required, it just simply doesn't allow you to set its value to false. I think we should remove the ability for boolean fields to be required.
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.