Comments (6)
Can't reproduce in my REPL:
~/brainy (development) > class Model
~/brainy (development) * include NoBrainer::Document
~/brainy (development) * end
=> class #<Class:0x00000005cf47c0>::Model < Object {
:id => :object,
:created_at => :object,
:updated_at => :object
}
~/brainy (development) > Model.fields
=> {
:id => {
:default => #<Proc:0x00000005b25c28@/home/pafy/nobrainer/lib/no_brainer/document/id.rb:9 (lambda)>
},
:created_at => {},
:updated_at => {}
}
from nobrainer.
Very strange. I just reproduced with a very simple example:
require 'nobrainer'
class MyModel
include NoBrainer::Document
end
MyModel.fields.each_key do |name|
puts "Field #{name}: #{MyModel.fields[name]}"
end
Produces:
Field id: {:default=>#<Proc:0x007ff17598a698@/Users/andy/.rvm/gems/ruby-2.0.0-p247/bundler/gems/nobrainer-113d37cea1f6/lib/no_brainer/document/id.rb:9 (lambda)>}
from nobrainer.
I see, I have the same issue if NoBrainer.configure { }
is never called.
from nobrainer.
It must be something more than that. I get the same results with:
class MyModel
include NoBrainer::Document
end
NoBrainer.configure do |config|
end
MyModel.fields.each_key do |name|
puts "Field #{name}: #{MyModel.fields[name]}"
end
from nobrainer.
configure before declaring the class
from nobrainer.
Gotcha. Thanks.
from nobrainer.
Related Issues (20)
- Issue with the command to sync the indexes HOT 13
- How to get list of databases (r.dbList) HOT 1
- DEPRECATION WARNING: `Module#parent` has been renamed to `module_parent`. `parent` is deprecated and will be removed in Rails 6.1. HOT 2
- Declare nested fields HOT 2
- unable to upsert HOT 2
- new rails 6 app Can't create a scaffold HOT 1
- try to use carrierwave-base64 with nobrainer HOT 2
- Index for multi tenancy HOT 5
- "warning: connection.rb:22: warning: URI.unescape is obsolete" with Ruby 2.7
- "undefined method `<<' for false:FalseClass" on `machine_id` from `NoBrainer::Document::PrimaryKey::Generator._generate` with Rspec HOT 1
- Prepare for Ruby 3 HOT 1
- Not working with activesupport - 6.1.0 HOT 6
- Support for range query using compound index?
- Fix the CI not running the tests anymore HOT 1
- Add support for the `store_accessor` method
- Dear Contributors, we'd like to discuss purchasing the domain name "nobrainer.io" HOT 5
- upsert won't work with polymorphic association
- Issue with the polymorphism association
- Deprecate Ruby 1.9 HOT 1
- Querying a polymorphic association doesn't work HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nobrainer.