![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Unidom (UNIfied Domain Object Model) is a series of domain model engines. The Geo domain model engine includes Town and Location models. Unidom (统一领域对象模型)是一系列的领域模型引擎。地理领域模型引擎包括乡镇和街道地址的模型。
Check out the Road Map to find out what's the next. Check out the Change Log to find out what's new.
gem 'unidom-geo'
rake db:migrate
The migration versions start with 200104.
Unidom::Geo::Location.valid_at.alive.first.region
active_locatings = location.locatings.valid_at.alive
# Locate: associate a shop, an estate, or a facility with a location
location.locate! shop, by: person
# or
Unidom::Geo::Locating.locate! location: location, located: shop
# Determine whether a shop was located to a given location at a given time.
location.locate? shop, at: Time.now
include Unidom::Geo::Concerns::AsLocated
include Unidom::Geo::Concerns::AsLocator
include Unidom::Geo::Concerns::AsRegion
The As Located concern do the following tasks for the includer automatically:
has_many :locatings, class_name: 'Unidom::Geo::Locating', as: :located
has_many :locations, through: :locatings, source: :location
is_located!(to: nil, by: nil, at: Time.now)
is_located?(to: nil, at: Time.now)
The As Locator concern do the following tasks for the includer automatically:
has_many :locatings, class_name: 'Unidom::Geo::Locating', as: :locator
has_many :locations, through: :locatings, source: :location
locate!(it, to: nil, at: Time.now)
The As Region concern do the following tasks for the includer automatically:
has_many :locations, class_name: 'Unidom::Geo::Location'
has_many :locatings, through: :locations, source: :locatings
If you only need the app components other than models, the migrations should be neglected, and the models should not be loaded.
# config/initializers/unidom.rb
Unidom::Common.configure do |options|
options[:neglected_namespaces] = %w{
Unidom::Geo
}
end
# spec/models/unidom_spec.rb
require 'unidom/geo/models_rspec'
# spec/types/unidom_spec.rb
require 'unidom/geo/types_rspec'
# spec/validators/unidom_spec.rb
require 'unidom/geo/validators_rspec'
# lib/unidom.rb
def initialize_unidom
Unidom::Party::Person.class_eval do
include Unidom::Geo::Concerns::AsLocator
end
Unidom::Party::Shop.class_eval do
include Unidom::Geo::Concerns::AsLocated
end
Unidom::Geo::China::Region.class_eval do
include Unidom::Geo::Concerns::AsRegion
end
end
# spec/rails_helper.rb
require 'unidom'
initialize_unidom
# spec/support/unidom_rspec_shared_examples.rb
require 'unidom/geo/rspec_shared_examples'
# spec/models/unidom/party/person_spec.rb
describe Unidom::Party::Person, type: :model do
context do
model_attributes = {
name: 'Tim'
}
located_attributes = {
name: 'Walmart'
}
located = Unidom::Party::Shop.create! located_attributes
it_behaves_like 'Unidom::Geo::Concerns::AsLocator', model_attributes, located
end
end
# spec/models/unidom/party/shop_spec.rb
describe Unidom::Party::Shop, type: :model do
context do
model_attributes = {
name: 'Some Shop'
}
location_attributes = {
postal_address: '#1 Some Street',
postal_code: '610000',
region_id: SecureRandom.uuid,
region_type: 'Unidom::Geo::Region::Mock'
}
location = Unidom::Geo::Location.create! location_attributes
locator_attributes = {
name: 'Tim'
}
locator = Unidom::Party::Person.create! locator_attributes
it_behaves_like 'Unidom::Geo::Concerns::AsLocated', model_attributes, location, locator
end
end
# spec/models/unidom/geo/china/region_spec.rb
describe Unidom::Geo::China::Region, type: :model do
context do
model_attributes = {
numeric_code: '999897',
name: 'Some Region',
scheme_id: SecureRandom.uuid,
scheme_type: 'Unidom::Geo::China::Scheme::Mock'
}
it_behaves_like 'Unidom::Geo::Concerns::AsRegion', model_attributes
end
end
FAQs
Unknown package
We found that unidom-geo demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.