-
Notifications
You must be signed in to change notification settings - Fork 68
Open
Description
I'm finally getting around to upgrading to Avram 1.4.0 and after updating my base model to this:
abstract class BaseModel < Avram::Model
def self.read_database : Avram::Database.class
AppDatabase
end
def self.write_database : Avram::Database.class
AppDatabase
end
macro default_columns
primary_key id : UUID
timestamps
end
endI get this error:
The class method `database` must be defined on CampaignAudienceStat, the BaseModel,
or defined as separate `read_database` and `write_database` class methods.
Example:
def self.database : Avram::Database.class
AppDatabase
end
Or separated as:
def self.read_database : Avram::Database.class
ReadDatabase
end
def self.write_database : Avram::Database.class
WriteDatabase
end (Exception)
My CampaignAudienceStat model looks like this:
class CampaignAudienceStat < BaseModel
# TODO: figure out why this is needed
skip_schema_enforcer
view materialized: true do
column user_id : UUID
column username : String
# some other columns
end
endI added the self.database method back in and now it's all happy... I just don't know why.
Metadata
Metadata
Assignees
Labels
No labels