![PyPI Now Supports iOS and Android Wheels for Mobile Python Development](https://cdn.sanity.io/images/cgdhsj6q/production/96416c872705517a6a65ad9646ce3e7caef623a0-1024x1024.webp?w=400&fit=max&auto=format)
Security News
PyPI Now Supports iOS and Android Wheels for Mobile Python Development
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Unidom (UNIfied Domain Object Model) is a series of domain model engines. The Contact domain model engine includes Contact Subscription and Email Address 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-contact'
rake db:migrate
The migration versions start with 200103.
contact = Unidom::Contact::China::MobilePhoneNumber.phone_number_is('13912345678').valid_at.alive.first_or_create!
subscriber = Unidom::Party::Person.create! name: 'John'
subscription = Unidom::Contact::ContactSubscription.subscribe! contact: contact, subscriber: subscriber, name: 'John Mobile', primary: true, grade: 0, priority: 0, opened_at: Time.now
# or
subscription = Unidom::Contact::ContactSubscription.subscribe! contact: contact, subscriber: subscriber
# Associate the subscriber & the contact
Unidom::Contact::ContactSubscription.subscribed_by(subscriber).valid_at.alive
# Get a list of all contact subscriptions of subscriber
Unidom::Contact::ContactSubscription.contact_is(contact).valid_at.alive
# Get a list of all contact subscriptions of contact
Unidom::Contact::EmailAddress.full_address_is('topbit.du@gmail.com').first
# Find the Email Address
include Unidom::Contact::Concerns::AsContact
include Unidom::Contact::Concerns::AsSubscriber
include Unidom::Contact::Concerns::AsEmailAddressSubscriber
The As Contact concern do the following tasks for the includer automatically:
Define the has_many :contact_subscriptions macro as: has_many :contact_subscriptions, class_name: 'Unidom::Contact::ContactSubscription', as: :contact
Define the #is_subscribed_as_contact! method as: is_subscribed_as_contact!(by: nil, at: Time.now, name: by.try(:name), primary: true)
Define the #is_subscribed_as_contact? method as: is_subscribed_as_contact?(by: nil, at: Time.now, primary: true)
The As Subscriber concern do the following tasks for the includer automatically:
Define the has_many :contact_subscriptions macro as: has_many :contact_subscriptions, class_name: 'Unidom::Contact::ContactSubscription', as: :subscriber
Define the #subscribe_contact! method as: subscribe_contact!(contact, at: Time.now, name: nil, primary: true)
Define the #subscribe_contact? method as: subscribe_contact?(contact, at: Time.now, primary: true)
The As Email Address Subscriber concern do the following tasks for the includer automatically:
Include the As Subscriber concern
Define the has_many :email_addresses macro as: has_many :email_addresses, through: :contact_subscriptions, source: :contact, source_type: 'Unidom::Contact::EmailAddress'
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::Contact
}
end
# spec/models/unidom_spec.rb
require 'unidom/contact/models_rspec'
# spec/types/unidom_spec.rb
require 'unidom/contact/types_rspec'
# spec/validators/unidom_spec.rb
require 'unidom/contact/validators_rspec'
# lib/unidom.rb
def initialize_unidom
Unidom::Party::Person.class_eval do
include Unidom::Contact::Concerns::AsSubscriber
end
#Unidom::Contact::EmailAddress.class_eval do
# include Unidom::Contact::Concerns::AsContact
#end
end
# spec/rails_helper.rb
require 'unidom'
initialize_unidom
# spec/support/unidom_rspec_shared_examples.rb
require 'unidom/contact/rspec_shared_examples'
# spec/models/unidom/party/person_spec.rb
describe Unidom::Party::Person do
model_attribtues = {
name: 'Tim'
}
it_behaves_like 'Unidom::Contact::Concerns::AsSubscriber', model_attribtues
end
# spec/models/unidom/contact/email_address_spec.rb
describe Unidom::Position::Post do
model_attributes = {
personalized_name: 'Tim Jason',
full_address: 'tim.jason@company.com'
}
it_behaves_like 'Unidom::Contact::Concerns::AsContact', model_attributes
end
FAQs
Unknown package
We found that unidom-contact 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
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
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.